Commit dc05cbd5 authored by Christoph Cullmann's avatar Christoph Cullmann 🍨
Browse files

nicer cleanup of main window

use the	fact that toolviews deregister themself
ensure the id mapping is clean afterwards, too
parent f9a2e475
......@@ -1338,10 +1338,13 @@ MainWindow::MainWindow(QWidget *parentWidget)
MainWindow::~MainWindow()
{
// move toolviews as deleting them will
// modify m_toolviews. see toolViewDeleted
auto toolviews = m_toolviews;
qDeleteAll(toolviews);
// kill all toolviews, they will deregister themself
while (!m_toolviews.empty()) {
delete m_toolviews.back();
}
// cleanup of toolviews should have de-registered all of them
Q_ASSERT(m_idToWidget.empty());
// seems like we really should delete this by hand ;)
delete m_centralWidget;
......
Supports Markdown
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