]> git.lyx.org Git - features.git/commitdiff
Fix memory leak.
authorAbdelrazak Younes <younes@lyx.org>
Sat, 9 Jan 2010 16:21:37 +0000 (16:21 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 9 Jan 2010 16:21:37 +0000 (16:21 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32913 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp

index 79ebb70c74faaef1b8bfbc06e1ec785bfe0310f4..0c4fe82eaec3ce542827ffaeac308fc7bcac706b 100644 (file)
@@ -350,8 +350,10 @@ Buffer::~Buffer()
        Impl::BufferPositionMap::iterator end = d->children_positions.end();
        for (; it != end; ++it) {
                Buffer * child = const_cast<Buffer *>(it->first);
+               if (d->cloned_buffer_)
+                       delete child;
                // The child buffer might have been closed already.
-               if (theBufferList().isLoaded(child))
+               else if (theBufferList().isLoaded(child))
                        theBufferList().releaseChild(this, child);
        }