Commit 8110c887 authored by Kai Koehne's avatar Kai Koehne

Fix crash on close in sidebar/bookmarks view

Explicitly close all views of the sidebar _before_ the core is
destructed. E.g. the bookmarks view tries to access the core in
it's destructor.
parent 3ccc079c
......@@ -283,9 +283,6 @@ MainWindow::~MainWindow()
delete m_rightPaneWidget;
m_rightPaneWidget = 0;
delete m_navigationWidget;
m_navigationWidget = 0;
delete m_modeManager;
m_modeManager = 0;
delete m_mimeDatabase;
......@@ -366,7 +363,11 @@ void MainWindow::closeEvent(QCloseEvent *event)
}
emit m_coreImpl->coreAboutToClose();
writeSettings();
m_navigationWidget->closeSubWidgets();
event->accept();
}
......
......@@ -340,6 +340,15 @@ void NavigationWidget::restoreSettings(QSettings *settings)
}
}
void NavigationWidget::closeSubWidgets()
{
foreach (NavigationSubWidget *subWidget, m_subWidgets) {
subWidget->saveSettings();
delete subWidget;
}
m_subWidgets.clear();
}
void NavigationWidget::setShown(bool b)
{
if (m_shown == b)
......
......@@ -92,6 +92,8 @@ public:
void saveSettings(QSettings *settings);
void restoreSettings(QSettings *settings);
void closeSubWidgets();
bool isShown() const;
void setShown(bool b);
......
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