Commit 1ce92c0e authored by hjk's avatar hjk
Browse files

debugger: centralize view cleanup in the manager to setState(DebuggerNotReady)

parent 37add8b5
...@@ -1027,11 +1027,10 @@ void DebuggerManager::cleanupViews() ...@@ -1027,11 +1027,10 @@ void DebuggerManager::cleanupViews()
void DebuggerManager::exitDebugger() void DebuggerManager::exitDebugger()
{ {
STATE_DEBUG(""); // The engine will finally call setState(DebuggerNotReady) which
if (d->m_engine) // in turn will handle the cleanup.
if (d->m_engine && state() != DebuggerNotReady)
d->m_engine->exitDebugger(); d->m_engine->exitDebugger();
cleanupViews();
setState(DebuggerNotReady);
} }
DebuggerStartParametersPtr DebuggerManager::startParameters() const DebuggerStartParametersPtr DebuggerManager::startParameters() const
...@@ -1139,19 +1138,13 @@ void DebuggerManager::executeDebuggerCommand(const QString &command) ...@@ -1139,19 +1138,13 @@ void DebuggerManager::executeDebuggerCommand(const QString &command)
void DebuggerManager::sessionLoaded() void DebuggerManager::sessionLoaded()
{ {
cleanupViews();
setState(DebuggerNotReady);
setBusyCursor(false);
loadSessionData(); loadSessionData();
} }
void DebuggerManager::aboutToUnloadSession() void DebuggerManager::aboutToUnloadSession()
{ {
cleanupViews();
if (d->m_engine) if (d->m_engine)
d->m_engine->shutdown(); d->m_engine->shutdown();
setState(DebuggerNotReady);
setBusyCursor(false);
} }
void DebuggerManager::aboutToSaveSession() void DebuggerManager::aboutToSaveSession()
...@@ -1626,6 +1619,7 @@ void DebuggerManager::setState(DebuggerState state) ...@@ -1626,6 +1619,7 @@ void DebuggerManager::setState(DebuggerState state)
if (d->m_state == DebuggerNotReady) { if (d->m_state == DebuggerNotReady) {
setBusyCursor(false); setBusyCursor(false);
cleanupViews();
emit debuggingFinished(); emit debuggingFinished();
} }
......
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