Debugger: Fix crash on shutdown

If the application fails to start (like an empty exe file), the debugger
remains in "active" state, and it crashes on shutdown.

Change-Id: I6ae3a98d507856ea40375edb15c9ea4605e3efc6
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Orgad Shaneh
2017-04-04 16:20:38 +03:00
committed by Orgad Shaneh
parent 43cc499409
commit 8a4b0aeabf

View File

@@ -1914,12 +1914,13 @@ void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project)
for (int i = 0, n = m_snapshotHandler->size(); i != n; ++i) { for (int i = 0, n = m_snapshotHandler->size(); i != n; ++i) {
// Run controls might be deleted during exit. // Run controls might be deleted during exit.
if (DebuggerEngine *engine = m_snapshotHandler->at(i)) { if (DebuggerEngine *engine = m_snapshotHandler->at(i)) {
DebuggerRunControl *runControl = engine->runControl(); if (DebuggerRunControl *runControl = engine->runControl()) {
RunConfiguration *rc = runControl->runConfiguration(); RunConfiguration *rc = runControl->runConfiguration();
if (rc == activeRc) { if (rc == activeRc) {
m_snapshotHandler->setCurrentIndex(i); m_snapshotHandler->setCurrentIndex(i);
updateState(engine); updateState(engine);
return; return;
}
} }
} }
} }