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

This commit is contained in:
Christiaan Janssen
2010-11-16 16:17:16 +01:00
parent da84000313
commit d992b223f6
2 changed files with 18 additions and 13 deletions

View File

@@ -83,10 +83,8 @@ QmlCppEngine::QmlCppEngine(const DebuggerStartParameters &sp)
QmlCppEngine::~QmlCppEngine()
{
if (d->m_qmlEngine)
delete d->m_qmlEngine;
if (d->m_cppEngine)
delete d->m_cppEngine;
delete d->m_qmlEngine;
delete d->m_cppEngine;
}
void QmlCppEngine::editorChanged(Core::IEditor *editor)
@@ -483,7 +481,7 @@ void QmlCppEngine::shutdownInferior()
{
if (!checkErrorState(InferiorShutdownFailed)) {
if (d->m_cppEngine->state() == InferiorStopOk) {
d->m_cppEngine->shutdownInferior();
d->m_cppEngine->quitDebugger();
} else {
notifyInferiorShutdownOk();
}
@@ -499,13 +497,19 @@ void QmlCppEngine::initEngineShutdown()
d->m_cppEngine->quitDebugger();
} else
if (state() == EngineSetupRequested) {
if (!checkErrorState(EngineSetupFailed)) {
if (!runControl() || d->m_errorState == EngineSetupFailed) {
notifyEngineSetupFailed();
} else {
notifyEngineSetupOk();
}
} else
if (state() == InferiorStopRequested) {
checkErrorState(InferiorStopFailed);
} else {
} else
if (state() == InferiorShutdownRequested && !checkErrorState(InferiorShutdownFailed)) {
notifyInferiorShutdownOk();
} else
if (state() != DebuggerFinished) {
quitDebugger();
}
}
@@ -518,11 +522,6 @@ void QmlCppEngine::shutdownEngine()
}
}
void QmlCppEngine::setupSlaveEngineOnTimer()
{
QTimer::singleShot(0, this, SLOT(setupSlaveEngine()));
}
void QmlCppEngine::setupSlaveEngine()
{
if (d->m_qmlEngine->state() == DebuggerNotReady)
@@ -620,6 +619,13 @@ void QmlCppEngine::engineStateChanged(const DebuggerState &newState)
}
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:
initEngineShutdown();
break;

View File

@@ -107,7 +107,6 @@ private slots:
void editorChanged(Core::IEditor *editor);
private:
void setupSlaveEngineOnTimer();
void initEngineShutdown();
bool checkErrorState(const DebuggerState stateToCheck);
void engineStateChanged(const DebuggerState &newState);