From e9e21cf30deadd5195c4e3381cc8ad0dec2a0cbb Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Wed, 6 Mar 2019 15:39:22 +0100 Subject: [PATCH] #4171 Work around assert failure when closing main window last --- ApplicationCode/UserInterface/RiuMainWindow.cpp | 2 ++ ApplicationCode/UserInterface/RiuPlotMainWindow.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ApplicationCode/UserInterface/RiuMainWindow.cpp b/ApplicationCode/UserInterface/RiuMainWindow.cpp index f873d0a79b..be5291d771 100644 --- a/ApplicationCode/UserInterface/RiuMainWindow.cpp +++ b/ApplicationCode/UserInterface/RiuMainWindow.cpp @@ -264,6 +264,8 @@ void RiuMainWindow::closeEvent(QCloseEvent* event) if (app->isMainPlotWindowVisible()) { + event->ignore(); // Make Qt think we don't do anything, otherwise it closes the window. + this->hide(); // Instead we just hide it. return; } diff --git a/ApplicationCode/UserInterface/RiuPlotMainWindow.cpp b/ApplicationCode/UserInterface/RiuPlotMainWindow.cpp index 8ef23d90c0..58ce108e78 100644 --- a/ApplicationCode/UserInterface/RiuPlotMainWindow.cpp +++ b/ApplicationCode/UserInterface/RiuPlotMainWindow.cpp @@ -169,6 +169,8 @@ void RiuPlotMainWindow::closeEvent(QCloseEvent* event) if (app->isMain3dWindowVisible()) { + event->ignore(); + this->hide(); return; }