Commit d992b223 authored by Christiaan Janssen's avatar Christiaan Janssen
Browse files

QmlDebugger: Fixing QmlCppEngine for failed setup due to timed out connection

parent da840003
...@@ -83,10 +83,8 @@ QmlCppEngine::QmlCppEngine(const DebuggerStartParameters &sp) ...@@ -83,10 +83,8 @@ QmlCppEngine::QmlCppEngine(const DebuggerStartParameters &sp)
QmlCppEngine::~QmlCppEngine() QmlCppEngine::~QmlCppEngine()
{ {
if (d->m_qmlEngine) delete d->m_qmlEngine;
delete d->m_qmlEngine; delete d->m_cppEngine;
if (d->m_cppEngine)
delete d->m_cppEngine;
} }
void QmlCppEngine::editorChanged(Core::IEditor *editor) void QmlCppEngine::editorChanged(Core::IEditor *editor)
...@@ -483,7 +481,7 @@ void QmlCppEngine::shutdownInferior() ...@@ -483,7 +481,7 @@ void QmlCppEngine::shutdownInferior()
{ {
if (!checkErrorState(InferiorShutdownFailed)) { if (!checkErrorState(InferiorShutdownFailed)) {
if (d->m_cppEngine->state() == InferiorStopOk) { if (d->m_cppEngine->state() == InferiorStopOk) {
d->m_cppEngine->shutdownInferior(); d->m_cppEngine->quitDebugger();
} else { } else {
notifyInferiorShutdownOk(); notifyInferiorShutdownOk();
} }
...@@ -499,13 +497,19 @@ void QmlCppEngine::initEngineShutdown() ...@@ -499,13 +497,19 @@ void QmlCppEngine::initEngineShutdown()
d->m_cppEngine->quitDebugger(); d->m_cppEngine->quitDebugger();
} else } else
if (state() == EngineSetupRequested) { if (state() == EngineSetupRequested) {
if (!checkErrorState(EngineSetupFailed)) { if (!runControl() || d->m_errorState == EngineSetupFailed) {
notifyEngineSetupFailed();
} else {
notifyEngineSetupOk(); notifyEngineSetupOk();
} }
} else } else
if (state() == InferiorStopRequested) { if (state() == InferiorStopRequested) {
checkErrorState(InferiorStopFailed); checkErrorState(InferiorStopFailed);
} else { } else
if (state() == InferiorShutdownRequested && !checkErrorState(InferiorShutdownFailed)) {
notifyInferiorShutdownOk();
} else
if (state() != DebuggerFinished) {
quitDebugger(); quitDebugger();
} }
} }
...@@ -518,11 +522,6 @@ void QmlCppEngine::shutdownEngine() ...@@ -518,11 +522,6 @@ void QmlCppEngine::shutdownEngine()
} }
} }
void QmlCppEngine::setupSlaveEngineOnTimer()
{
QTimer::singleShot(0, this, SLOT(setupSlaveEngine()));
}
void QmlCppEngine::setupSlaveEngine() void QmlCppEngine::setupSlaveEngine()
{ {
if (d->m_qmlEngine->state() == DebuggerNotReady) if (d->m_qmlEngine->state() == DebuggerNotReady)
...@@ -620,6 +619,13 @@ void QmlCppEngine::engineStateChanged(const DebuggerState &newState) ...@@ -620,6 +619,13 @@ void QmlCppEngine::engineStateChanged(const DebuggerState &newState)
} }
break; break;
case EngineShutdownRequested:
// we have to abort the setup before the sub-engines die
// because we depend on an active runcontrol that will be shut down by the dying engine
if (state() == EngineSetupRequested)
notifyEngineSetupFailed();
break;
case DebuggerFinished: case DebuggerFinished:
initEngineShutdown(); initEngineShutdown();
break; break;
......
...@@ -107,7 +107,6 @@ private slots: ...@@ -107,7 +107,6 @@ private slots:
void editorChanged(Core::IEditor *editor); void editorChanged(Core::IEditor *editor);
private: private:
void setupSlaveEngineOnTimer();
void initEngineShutdown(); void initEngineShutdown();
bool checkErrorState(const DebuggerState stateToCheck); bool checkErrorState(const DebuggerState stateToCheck);
void engineStateChanged(const DebuggerState &newState); void engineStateChanged(const DebuggerState &newState);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment