Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.3.0
-
None
-
3
-
bf3fc5c95c (qt/qtbase/dev) bf3fc5c95c (qt/tqtc-qtbase/dev) 841f04f309 (qt/qtbase/6.4) 841f04f309 (qt/tqtc-qtbase/6.4) 98b9b719c7 (qt/qtbase/6.3) 98b9b719c7 (qt/tqtc-qtbase/6.3)
-
Team A Foundation Sprint 59
Description
Given the following code:
QFuture<int> getInteger() { auto promise = QSharedPointer<QPromise<int>>::create(); QTimer::singleShot(1000, qApp, [promise] () mutable { promise->start(); QTimer::singleShot(1000, qApp, [] () { qApp->quit(); }); }); return promise->future(); } int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); auto future = getInteger(); future .onCanceled([]{ qDebug() << "Canceled"; return -1; }); QFutureWatcher<int> watcher; watcher.setFuture(future); QObject::connect(&watcher, &QFutureWatcher<int>::canceled, []{ qDebug() << "watcher canceled"; }); QObject::connect(&watcher, &QFutureWatcher<int>::finished, []{ qDebug() << "watcher finished"; }); QObject::connect(&watcher, &QFutureWatcher<int>::started, []{ qDebug() << "watcher started"; }); return a.exec(); }
WIth Qt 6.2.4 and Qt 6.1.3 we have the correct output:
Canceled watcher started watcher canceled watcher finished
However, with Qt 6.3.0, or the latest 6.4 snapshot, the onCanceled handler in never called:
watcher started watcher canceled watcher finished
Attachments
For Gerrit Dashboard: QTBUG-103992 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
417368,4 | QPromise: run continuation(s) on destruction | dev | qt/qtbase | Status: MERGED | +2 | 0 |
417890,2 | QPromise: run continuation(s) on destruction | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |
417891,2 | QPromise: run continuation(s) on destruction | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |
417897,1 | QPromise: run continuation(s) on destruction | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: ABANDONED | 0 | 0 |
418360,3 | QPromise: remove the superfluous cleanContinuation() call | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |