From fdbdf2d14f4a7188ab029d99af83b7eb2dc490ee Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 16 Mar 2012 12:55:00 +0100 Subject: [PATCH] QmlEngine: Fix crash when trying to connect Since we directly called beginConnection in connectionStartupFailed we got a stack overflow over time. Instead, only try to connect every 3 seconds. Also remove special logic for mixed debugging: They should behave the same (except maybe where you're breaking inside QQmlDebugServer, but that's a corner case). Change-Id: Idf2f55e3d905a01065c123c708b50dbb88388d1f Reviewed-by: Aurindam Jana --- src/plugins/debugger/qml/qmlengine.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 3e31aeddc4d..1da0baf8ab0 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -364,7 +364,10 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters, SLOT(documentUpdated(QmlJS::Document::Ptr))); // we won't get any debug output - d->m_retryOnConnectFail = startParameters.useTerminal; + if (startParameters.useTerminal) { + d->m_noDebugOutputTimer.setInterval(0); + d->m_retryOnConnectFail = true; + } } QmlEngine::~QmlEngine() @@ -416,6 +419,7 @@ void QmlEngine::connectionEstablished() void QmlEngine::tryToConnect(quint16 port) { + showMessage(QLatin1String("QML Debugger: No application output received in time, trying to connect ..."), LogStatus); d->m_retryOnConnectFail = true; beginConnection(port); } @@ -447,15 +451,9 @@ void QmlEngine::beginConnection(quint16 port) void QmlEngine::connectionStartupFailed() { - if (isSlaveEngine()) { - if (masterEngine()->state() != InferiorRunOk) { - // we're right now debugging C++, just try longer ... - beginConnection(); - return; - } - } if (d->m_retryOnConnectFail) { - beginConnection(); + // retry after 3 seconds ... + QTimer::singleShot(3000, this, SLOT(beginConnection())); return; }