]> git.lyx.org Git - features.git/commitdiff
Make sure we aren't trying to reuse the global variable, and make
authorRichard Heck <rgheck@comcast.net>
Thu, 17 Nov 2011 18:26:42 +0000 (18:26 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 17 Nov 2011 18:26:42 +0000 (18:26 +0000)
sure we aren't leaking any cloned buffers.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40208 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp

index 6f2303e6099066b0e335c8767c879cc9b9ebca16..da64676d7bd0a47d7776533d48a399d90d4ceab2 100644 (file)
@@ -458,8 +458,11 @@ Buffer * Buffer::clone() const
        LASSERT(bit != bufmap.end(), return 0);
        Buffer * cloned_buffer = bit->second;
 
+       // this should be empty. if not, then either we have left
+       // some buffer undeleted, or else we are trying to export
+       // two buffers at once. either way is a problem.
+       LASSERT(cloned_buffer_list.empty(), return 0);
        // record the list of cloned buffers in the cloned master
-       cloned_buffer_list.clear();
        BufferMap::iterator it = bufmap.begin();
        BufferMap::iterator en = bufmap.end();
        for (; it != en; ++it)