From d1074d1dbc34eaba7034bdde73d6d16ea40c5fc2 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sat, 14 Feb 2009 16:49:28 +0000 Subject: [PATCH] Fix a crash on exit when the child documents are already unloaded. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28492 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 90685fe6bc..14b502825d 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -289,8 +289,11 @@ Buffer::~Buffer() // loop over children Impl::BufferPositionMap::iterator it = d->children_positions.begin(); Impl::BufferPositionMap::iterator end = d->children_positions.end(); - for (; it != end; ++it) - theBufferList().releaseChild(this, const_cast(it->first)); + for (; it != end; ++it) { + // The child buffer might have been closed already. + if (theBufferList().isLoaded(child)) + theBufferList().releaseChild(this, const_cast(it->first)); + } // clear references to children in macro tables d->children_positions.clear(); -- 2.39.5