From f741d3131ddf6ac50ba9e73e4346428a5dc022a5 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 13 Mar 2016 12:51:27 +0800 Subject: [PATCH] Delete all mainwindow child widgets. Closes #4871, #5049. Some of the `delete` can be handled by the findChild loop --- src/gui/mainwindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 6eb6d1c61..b9dbbb0f8 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -654,12 +654,12 @@ void MainWindow::cleanup() #if (defined(Q_OS_WIN) || defined(Q_OS_MAC)) m_programUpdateTimer->stop(); #endif - delete m_searchFilter; + delete m_searchFilterAction; - delete m_tabs; // this seems enough to also delete all contained widgets - delete m_statusBar; - delete m_pwr; - delete m_toolbarMenu; + + // remove all child widgets + while (QWidget *w = findChild()) + delete w; } void MainWindow::readSettings()