From 9dd4bc6e846d4888dcfd433caa21211561ae55ab Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Thu, 25 Jan 2024 15:20:09 +0100 Subject: 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 Pick-to: 6.7 Reviewed-by: Dominik Holland --- src/tools/launcher-qml/launcher-qml.cpp | 6 ++++-- 1 file 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; // 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(); -- cgit v1.2.3