diff options
author | Robert Griebl <robert.griebl@qt.io> | 2024-01-25 15:20:09 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-01-25 15:25:11 +0000 |
commit | d4e7782d9774539092ecac08e8634ca036ec226b (patch) | |
tree | bf4512ed5c488c57f5c1cd6609c66896777da11d | |
parent | 4a63a66d787997c346914e6de76a8c638ed07829 (diff) |
Fix QML debugger freeze on exit
We need to make sure that the QML engine dies before the qApp instance,
because otherwise the QML debugger thread's event loop is quit from too
early.
Change-Id: I57df9011dd4a1347289f9e17876c9b86217ba024
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
(cherry picked from commit 9dd4bc6e846d4888dcfd433caa21211561ae55ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/tools/launcher-qml/launcher-qml.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tools/launcher-qml/launcher-qml.cpp b/src/tools/launcher-qml/launcher-qml.cpp index a8d217ca..3163f547 100644 --- a/src/tools/launcher-qml/launcher-qml.cpp +++ b/src/tools/launcher-qml/launcher-qml.cpp @@ -114,6 +114,8 @@ int main(int argc, char *argv[]) StartupTimer::instance()->checkpoint("after basic initialization"); + std::unique_ptr<Controller> controller; // this needs to die BEFORE qApp does + if (!directLoadManifest.isEmpty()) { QString directLoadAppId; qsizetype appPos = directLoadManifest.indexOf(u"@"_s); @@ -126,11 +128,11 @@ int main(int argc, char *argv[]) if (!fi.exists() || fi.fileName() != u"info.yaml"_s) throw Exception("--directload needs a valid info.yaml file as parameter"); directLoadManifest = fi.absoluteFilePath(); - new Controller(&am, quicklaunched, qMakePair(directLoadManifest, directLoadAppId)); + controller.reset(new Controller(&am, quicklaunched, qMakePair(directLoadManifest, directLoadAppId))); } else { am.setupDBusConnections(); StartupTimer::instance()->checkpoint("after dbus initialization"); - new Controller(&am, quicklaunched); + controller.reset(new Controller(&am, quicklaunched)); } return am.exec(); |