diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index df06f15bfc..6a3cdb28b5 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1727,7 +1727,12 @@ bool GuiView::closeBuffer(Buffer & buf, bool tolastopened) if (buf.masterBuffer() == &buf && tolastopened) LyX::ref().session().lastOpened().add(buf.fileName()); - theBufferList().release(&buf); + if (buf.parent()) + // Don't close child documents. + removeWorkArea(d.current_work_area_); + else + theBufferList().release(&buf); + return true; }