forked from qt-creator/qt-creator
Fix crash whith external help open.
Running the external window will take down the central widget as well, cause calling m_externalWindow->setCentralWidget(m_centralWidget) will pass ownership to the window. Calling delete on the central widget inside the plugin constructor will crash, so set it to NULL. Change-Id: I88ddde68a1ca3a47182de7c19847808738431149 Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
This commit is contained in:
@@ -420,7 +420,12 @@ ExtensionSystem::IPlugin::ShutdownFlag HelpPlugin::aboutToShutdown()
|
|||||||
// depends on the always visible property of the sidebar...
|
// depends on the always visible property of the sidebar...
|
||||||
settings->setValue(QLatin1String("HelpSideBar/") + QLatin1String("Visible"), m_isSidebarVisible);
|
settings->setValue(QLatin1String("HelpSideBar/") + QLatin1String("Visible"), m_isSidebarVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_externalWindow) {
|
||||||
delete m_externalWindow;
|
delete m_externalWindow;
|
||||||
|
m_centralWidget = 0; // Running the external window will take down the central widget as well, cause
|
||||||
|
// calling m_externalWindow->setCentralWidget(m_centralWidget) will pass ownership to the window.
|
||||||
|
}
|
||||||
|
|
||||||
return SynchronousShutdown;
|
return SynchronousShutdown;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user