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 <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-12-05 10:23:10 +01:00
parent d2c03f771b
commit ed52d07727

View File

@@ -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();
}