Fix memory leak.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32913 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2010-01-09 16:21:37 +00:00
parent a397cc81c2
commit fefd99e836

View File

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