Debugger: Fix crash on close while debugging

Task-number: QTCREATORBUG-15987
Change-Id: I510add216ec16c0c6622870f26c68c16e99769ed
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Christian Stenger
2016-04-04 09:15:28 +02:00
parent 2706348040
commit 40b6413201
2 changed files with 11 additions and 2 deletions

View File

@@ -2502,6 +2502,8 @@ void DebuggerPluginPrivate::setInitialState()
void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
{
if (m_shuttingDown)
return;
QTC_ASSERT(engine, return);
QTC_ASSERT(m_watchersView->model(), return);
QTC_ASSERT(m_returnView->model(), return);
@@ -2647,6 +2649,8 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
void DebuggerPluginPrivate::updateDebugActions()
{
if (m_shuttingDown)
return;
//if we're currently debugging the actions are controlled by engine
if (m_currentEngine->state() != DebuggerNotReady)
return;
@@ -2775,6 +2779,8 @@ QTreeView *inspectorView()
void DebuggerPluginPrivate::showMessage(const QString &msg, int channel, int timeout)
{
if (m_shuttingDown)
return;
//qDebug() << "PLUGIN OUTPUT: " << channel << msg;
QTC_ASSERT(m_logWindow, return);
switch (channel) {

View File

@@ -232,8 +232,11 @@ bool DebuggerRunControl::promptToStop(bool *optionalPrompt) const
"Terminating the session in the current"
" state can leave the target in an inconsistent state."
" Would you still like to terminate it?");
return showPromptToStopDialog(tr("Close Debugging Session"), question,
QString(), QString(), optionalPrompt);
bool result = showPromptToStopDialog(tr("Close Debugging Session"), question,
QString(), QString(), optionalPrompt);
if (result)
disconnect(this);
return result;
}
RunControl::StopResult DebuggerRunControl::stop()