From ed52d0772786cd901b0803a1186feec69b1ecda4 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 5 Dec 2023 10:23:10 +0100 Subject: [PATCH] Qml Debugger: Don't complain about connection When the debugger is quit, connectionStartupFailed will trigger and show a useless message box about not being able to connect. This can also trigger a crash in WatchHandler::cleanup if the user quits Creator while a debugging session is still running. (as seen on macOS). Change-Id: I19461d5cdd449e58e530b09b772431b3cf18c52f Reviewed-by: hjk --- src/plugins/debugger/qml/qmlengine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 7ba162a28f8..7c907678aed 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -208,6 +208,7 @@ public: bool unpausedEvaluate = false; bool contextEvaluate = false; bool supportChangeBreakpoint = false; + bool hasQuit = false; QTimer connectionTimer; QmlDebug::QDebugMessageClient *msgClient = nullptr; @@ -379,6 +380,9 @@ void QmlEngine::beginConnection() void QmlEngine::connectionStartupFailed() { + if (d->hasQuit) + return; + if (d->retryOnConnectFail) { // retry after 3 seconds ... QTimer::singleShot(3000, this, [this] { beginConnection(); }); @@ -937,6 +941,7 @@ void QmlEngine::quitDebugger() { d->automaticConnect = false; d->retryOnConnectFail = false; + d->hasQuit = true; stopProcess(); closeConnection(); }