Commit 88033398 authored by Eike Ziller's avatar Eike Ziller
Browse files

Help: Fix crash when closing external help window



We need to explicitly remove the context that we registered for the
viewer in it. Otherwise it might happen that the deleted context object
is temporarily made "active" when the context for the whole window is
removed.

Change-Id: I903ae0a774751651cc2ec1661c0af8b8f7b3df2d
Task-number: QTCREATORBUG-12722
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent cf9d12ed
......@@ -102,10 +102,10 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
setFocusProxy(m_viewer);
Core::IContext *icontext = new Core::IContext(this);
icontext->setContext(context);
icontext->setWidget(m_viewer);
Core::ICore::addContextObject(icontext);
m_context = new Core::IContext(this);
m_context->setContext(context);
m_context->setWidget(m_viewer);
Core::ICore::addContextObject(m_context);
back->setEnabled(m_viewer->isBackwardAvailable());
connect(back, SIGNAL(triggered()), m_viewer, SLOT(backward()));
......@@ -171,6 +171,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
HelpWidget::~HelpWidget()
{
Core::ICore::removeContextObject(m_context);
Core::ActionManager::unregisterAction(m_copy, Core::Constants::COPY);
Core::ActionManager::unregisterAction(m_openHelpMode, Help::Constants::CONTEXT_HELP);
if (m_scaleUp)
......
......@@ -75,6 +75,7 @@ private slots:
void updateHelpModeButtonToolTip();
private:
Core::IContext *m_context;
QAction *m_switchToHelp;
QMenu *m_backMenu;
QMenu *m_forwardMenu;
......
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