Commit ff6251cb authored by hjk's avatar hjk Committed by hjk

Debugger: Fix handling of extra updates on view visibility changes

Using a lambda in the connect was wrong here, as the m_currentEngine
member may change before the body gets executed. Indirect to a member
slot again, which then can use an up-to-date m_currentEngine.

Change-Id: Ice906a31d2ba0655daffda67ae378acc98aa3698
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent b63f98a5
...@@ -702,6 +702,10 @@ public: ...@@ -702,6 +702,10 @@ public:
} }
} }
void reloadSourceFiles() { if (m_currentEngine) m_currentEngine->reloadSourceFiles(); }
void reloadRegisters() { if (m_currentEngine) m_currentEngine->reloadRegisters(); }
void reloadModules() { if (m_currentEngine) m_currentEngine->reloadModules(); }
void editorOpened(IEditor *editor); void editorOpened(IEditor *editor);
void updateBreakMenuItem(IEditor *editor); void updateBreakMenuItem(IEditor *editor);
void setBusyCursor(bool busy); void setBusyCursor(bool busy);
...@@ -1321,16 +1325,16 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, ...@@ -1321,16 +1325,16 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
m_modulesView = new ModulesTreeView; m_modulesView = new ModulesTreeView;
m_modulesView->setSettings(settings, "Debugger.ModulesView"); m_modulesView->setSettings(settings, "Debugger.ModulesView");
connect(m_modulesView, &BaseTreeView::aboutToShow, this, [this] { connect(m_modulesView, &BaseTreeView::aboutToShow,
m_currentEngine->reloadModules(); this, &DebuggerPluginPrivate::reloadModules,
}, Qt::QueuedConnection); Qt::QueuedConnection);
m_modulesWindow = addSearch(m_modulesView, tr("Modules"), DOCKWIDGET_MODULES); m_modulesWindow = addSearch(m_modulesView, tr("Modules"), DOCKWIDGET_MODULES);
m_registerView = new RegisterTreeView; m_registerView = new RegisterTreeView;
m_registerView->setSettings(settings, "Debugger.RegisterView"); m_registerView->setSettings(settings, "Debugger.RegisterView");
connect(m_registerView, &BaseTreeView::aboutToShow, this, [this] { connect(m_registerView, &BaseTreeView::aboutToShow,
m_currentEngine->reloadRegisters(); this, &DebuggerPluginPrivate::reloadRegisters,
}, Qt::QueuedConnection); Qt::QueuedConnection);
m_registerWindow = addSearch(m_registerView, tr("Registers"), DOCKWIDGET_REGISTER); m_registerWindow = addSearch(m_registerView, tr("Registers"), DOCKWIDGET_REGISTER);
m_stackView = new StackTreeView; m_stackView = new StackTreeView;
...@@ -1339,9 +1343,9 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, ...@@ -1339,9 +1343,9 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
m_sourceFilesView = new SourceFilesTreeView; m_sourceFilesView = new SourceFilesTreeView;
m_sourceFilesView->setSettings(settings, "Debugger.SourceFilesView"); m_sourceFilesView->setSettings(settings, "Debugger.SourceFilesView");
connect(m_sourceFilesView, &BaseTreeView::aboutToShow, this, [this] { connect(m_sourceFilesView, &BaseTreeView::aboutToShow,
m_currentEngine->reloadSourceFiles(); this, &DebuggerPluginPrivate::reloadSourceFiles,
}, Qt::QueuedConnection); Qt::QueuedConnection);
m_sourceFilesWindow = addSearch(m_sourceFilesView, tr("Source Files"), DOCKWIDGET_SOURCE_FILES); m_sourceFilesWindow = addSearch(m_sourceFilesView, tr("Source Files"), DOCKWIDGET_SOURCE_FILES);
m_threadsView = new ThreadsTreeView; m_threadsView = new ThreadsTreeView;
......
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