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:
kh1
2012-06-04 13:17:54 +02:00
committed by Karsten Heimrich
parent 73e07c9f2f
commit d3f3ab0115

View File

@@ -420,7 +420,12 @@ ExtensionSystem::IPlugin::ShutdownFlag HelpPlugin::aboutToShutdown()
// depends on the always visible property of the sidebar...
settings->setValue(QLatin1String("HelpSideBar/") + QLatin1String("Visible"), m_isSidebarVisible);
}
delete m_externalWindow;
if (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;
}