Commit d432b144 authored by Christian Stenger's avatar Christian Stenger

Debugger: Avoid crash in plugin unit test

Change-Id: I38d74f4a34e14f646eaf9f24ca9dc2e14ba06050
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 644ed0d4
......@@ -655,6 +655,9 @@ public:
void updateWatchersHeader(int section, int, int newSize)
{
if (m_shuttingDown)
return;
m_watchersView->header()->resizeSection(section, newSize);
m_returnView->header()->resizeSection(section, newSize);
}
......@@ -2357,6 +2360,9 @@ void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine)
if (m_currentEngine == engine)
return;
if (m_shuttingDown)
return;
if (m_currentEngine)
m_currentEngine->resetLocation();
m_currentEngine = engine;
......@@ -2741,6 +2747,8 @@ void DebuggerPluginPrivate::aboutToSaveSession()
void DebuggerPluginPrivate::showStatusMessage(const QString &msg0, int timeout)
{
if (m_shuttingDown)
return;
showMessage(msg0, LogStatus);
QString msg = msg0;
msg.replace(QChar::LineFeed, QLatin1String("; "));
......@@ -2750,6 +2758,10 @@ void DebuggerPluginPrivate::showStatusMessage(const QString &msg0, int timeout)
void DebuggerPluginPrivate::coreShutdown()
{
m_shuttingDown = true;
if (currentEngine()) {
currentEngine()->setTargetState(Debugger::DebuggerFinished);
currentEngine()->abortDebugger();
}
}
const CPlusPlus::Snapshot &cppCodeModelSnapshot()
......@@ -2886,6 +2898,8 @@ void DebuggerPluginPrivate::runControlStarted(DebuggerEngine *engine)
void DebuggerPluginPrivate::runControlFinished(DebuggerEngine *engine)
{
if (m_shuttingDown)
return;
showStatusMessage(tr("Debugger finished."));
m_snapshotHandler->removeSnapshot(engine);
if (m_snapshotHandler->size() == 0) {
......@@ -3672,7 +3686,8 @@ void DebuggerUnitTests::testStateMachine()
QTestEventLoop::instance().exitLoop();
});
// QTestEventLoop::instance().enterLoop(20);
QTestEventLoop::instance().enterLoop(5);
EditorManager::closeAllEditors(false);
}
......
......@@ -1254,7 +1254,8 @@ void WatchHandler::cleanup()
saveWatchers();
m_model->reinitialize();
emit m_model->updateFinished();
m_model->m_separatedView->hide();
if (Internal::mainWindow())
m_model->m_separatedView->hide();
}
static bool sortByName(const TreeItem *a, const TreeItem *b)
......
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