From d35a88289513c0420863b80aa6c1cb7d2c6e978f Mon Sep 17 00:00:00 2001 From: Mladen Milinkovic Date: Tue, 17 Jul 2018 09:45:30 +0200 Subject: Fix KMainWindow saving incorrect widget settings BUG: 395988 In certain cases KMainWindow::saveMainWindowSettings() could have been called after mainwindow started destroying itself. Window settings would be saved with incorrect child widget states. e.g. some widgets would be saved as hidden even if they were visible before destroying. --- src/kmainwindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kmainwindow.cpp b/src/kmainwindow.cpp index 810bf32..885ac60 100644 --- a/src/kmainwindow.cpp +++ b/src/kmainwindow.cpp @@ -524,6 +524,10 @@ void KMainWindow::closeEvent(QCloseEvent *e) } if (queryClose()) { + // widgets will start destroying themselves at this point and we don't + // want to save state anymore after this as it might be incorrect + d->autoSaveSettings = false; + d->letDirtySettings = false; e->accept(); } else { e->ignore(); //if the window should not be closed, don't close it -- cgit v0.11.2