From fefd99e836723ab8d87cb8790681ab60012f9f41 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sat, 9 Jan 2010 16:21:37 +0000 Subject: [PATCH] Fix memory leak. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32913 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 79ebb70c74..0c4fe82eae 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -350,8 +350,10 @@ Buffer::~Buffer() Impl::BufferPositionMap::iterator end = d->children_positions.end(); for (; it != end; ++it) { Buffer * child = const_cast(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); }