From f87218bbb50e2043d3a052803cdef0bbcdcbc338 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 17 Dec 2018 09:11:34 +0100 Subject: [PATCH] Check for hidden dirty child on close Fixes: #11405 --- src/frontends/qt4/GuiView.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 56f4f7b4c6..9d5f5dca6a 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -3069,9 +3069,13 @@ bool GuiView::closeBuffer(Buffer & buf) break; } else { // In this case the child buffer is open but hidden. - // It therefore should not (MUST NOT) be dirty! - LATTEST(child_buf->isClean()); - theBufferList().release(child_buf); + // Even in this case, children can be dirty (e.g., + // after a label change in the master, see #11405). + // Therefore, check this. + if (saveBufferIfNeeded(*child_buf, false)) { + child_buf->removeAutosaveFile(); + theBufferList().release(child_buf); + } } } } -- 2.39.5