]> git.lyx.org Git - features.git/commitdiff
Fix a crash on exit when the child documents are already unloaded.
authorVincent van Ravesteijn <vfr@lyx.org>
Sat, 14 Feb 2009 16:49:28 +0000 (16:49 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sat, 14 Feb 2009 16:49:28 +0000 (16:49 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28492 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp

index 90685fe6bca7eb19f33c7ae5284e2ff6a04e8aac..14b502825dd7daf2edd76d7ead116ba28cf29692 100644 (file)
@@ -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<Buffer *>(it->first));
+       for (; it != end; ++it) {
+               // The child buffer might have been closed already.
+               if (theBufferList().isLoaded(child))
+                       theBufferList().releaseChild(this, const_cast<Buffer *>(it->first));
+       }
 
        // clear references to children in macro tables
        d->children_positions.clear();