From a6274e559e72dbd28560bf7ccb5ffc42adeac8b5 Mon Sep 17 00:00:00 2001 From: Srivats P Date: Sun, 27 Nov 2016 11:45:15 +0530 Subject: [PATCH] sign: Delete streamStats docks before saving state Although streamStats docks are set to delete on close, this doesn't happen immediately, so save layout state still sees them which leads to a crash next time when application is started, state is restored and docks are moved - so instead of close, delete them directly --- client/mainwindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index 782717a..12fa8a5 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -133,11 +133,12 @@ MainWindow::~MainWindow() delete pgl; - // We don't want to save state for Stream Stats Docks - so close them + // We don't want to save state for Stream Stats Docks - so delete them QList streamStatsDocks = findChildren("streamStatsDock"); foreach(QDockWidget *dock, streamStatsDocks) - dock->close(); // this dock is already set to delete on close + delete dock; + Q_ASSERT(findChildren("streamStatsDock").size() == 0); QByteArray layout = saveState(0); appSettings->setValue(kApplicationWindowLayout, layout);