Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.6.1
-
Windows 10 22H2, MSVC 2019 x64
-
59e21a536 (dev), f89d80c90 (6.7), d5528cdec (6.6)
Description
Code
#include <QCoreApplication> #include <QFuture> #include <QTimer> int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); QPromise<QString> promise; promise.start(); // Wait 1 second and then complete the task QTimer::singleShot(1000, &app, [&] { promise.addResult("Task is complete"); qDebug("Finishing..."); promise.finish(); qDebug("...finished!"); }); promise.future().then(&app, [](const QString& result) { qDebug() << "Future lambda:" << result; qApp->quit(); }); return app.exec(); }
Expected outcomes (Qt 6.5.3)
Console prints the following, and the app quits:
Finishing... Future lambda: "Task is complete" ...finished!
Actual outcomes (Qt 6.6.1)
Console prints the following, and the app becomes unresponsive indefinitely:
Finishing...
Attachments
Issue Links
- is duplicated by
-
QTBUG-119406 QFuture::then() with context object deadlocks
- Closed
- relates to
-
QTBUG-119810 QFuture continuation with deleted context
- Closed
- resulted from
-
QTBUG-112958 QFuture: gracefully handle a destroyed context in continuations
- Closed