From cd602c9f6ee97c3953e68ba7da47e3d0b575201a Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 22 Jul 2014 10:41:28 +0200 Subject: [PATCH] Core: Avoid segmentation fault when executing plugin unit tests Change-Id: I80e4b73c36602542106aa3abbb1e3b147be58e6f Reviewed-by: Christian Stenger --- src/plugins/coreplugin/mainwindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index d900c8c5510..da19097ea45 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -242,6 +242,11 @@ bool MainWindow::isNewItemDialogRunning() const MainWindow::~MainWindow() { + // explicitly delete window support, because that calls methods from ICore that call methods + // from mainwindow, so mainwindow still needs to be alive + delete m_windowSupport; + m_windowSupport = 0; + ExtensionSystem::PluginManager::removeObject(m_shortcutSettings); ExtensionSystem::PluginManager::removeObject(m_generalSettings); ExtensionSystem::PluginManager::removeObject(m_toolSettings); @@ -372,11 +377,6 @@ void MainWindow::closeEvent(QCloseEvent *event) m_navigationWidget->closeSubWidgets(); event->accept(); - - // explicitly delete window support, because that calls methods from ICore that call methods - // from mainwindow, so mainwindow still needs to be alive - delete m_windowSupport; - m_windowSupport = 0; } void MainWindow::openDroppedFiles(const QStringList &files)