From: Juergen Spitzmueller Date: Mon, 17 Dec 2018 08:11:34 +0000 (+0100) Subject: Check for hidden dirty child on close X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=87ccefb316e92e56c0eaecf0d0a286d88a2110e1;p=features.git Check for hidden dirty child on close Fixes: #11405 --- 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); + } } } }