From b2517d60b8d05ad68c007e120e3b10059d043845 Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Mon, 18 May 2020 00:06:59 -0400 Subject: [PATCH] Fix bug #11405. We don't actually prevent hidden buffers from being dirty, so we need to save them if they are. --- src/frontends/qt/GuiView.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp index ba2951e4a6..87a4f32d68 100644 --- a/src/frontends/qt/GuiView.cpp +++ b/src/frontends/qt/GuiView.cpp @@ -3107,6 +3107,14 @@ void GuiView::writeSession() const { bool GuiView::closeBufferAll() { + + for (auto & buf : theBufferList()) { + if (!saveBufferIfNeeded(*buf, false)) { + // Closing has been cancelled, so abort. + return false; + } + } + // Close the workareas in all other views QList const ids = guiApp->viewIds(); for (int i = 0; i != ids.size(); ++i) { @@ -3118,9 +3126,6 @@ bool GuiView::closeBufferAll() if (!closeWorkAreaAll()) return false; - // Now close the hidden buffers. We prevent hidden buffers from being - // dirty, so we can just close them. - theBufferList().closeAll(); return true; }