]> git.lyx.org Git - features.git/commitdiff
Check for hidden dirty child on close
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 17 Dec 2018 08:11:34 +0000 (09:11 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 12:39:52 +0000 (14:39 +0200)
Fixes: #11405
src/frontends/qt4/GuiView.cpp

index 56f4f7b4c6d2119af50e1ae7b30d8a94b1a9ba10..9d5f5dca6a43a98b726d6062bb4466324085bf0a 100644 (file)
@@ -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);
+                               }
                        }
                }
        }