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,7 +1914,7 @@ void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project)
for (int i = 0, n = m_snapshotHandler->size(); i != n; ++i) {
// Run controls might be deleted during exit.
if (DebuggerEngine *engine = m_snapshotHandler->at(i)) {
DebuggerRunControl *runControl = engine->runControl();
if (DebuggerRunControl *runControl = engine->runControl()) {
RunConfiguration *rc = runControl->runConfiguration();
if (rc == activeRc) {
m_snapshotHandler->setCurrentIndex(i);
@@ -1923,6 +1923,7 @@ void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project)
}
}
}
}
// If we have a running debugger, don't touch it.
if (m_snapshotHandler->size())