]> git.lyx.org Git - features.git/commit
Fix memory errors found by Alfredo with valgrind
authorGeorg Baum <baum@lyx.org>
Wed, 12 Nov 2014 19:31:32 +0000 (20:31 +0100)
committerGeorg Baum <baum@lyx.org>
Wed, 12 Nov 2014 19:31:32 +0000 (20:31 +0100)
commit24426cc614685503024a1ba46d99b6bbb832c92e
treea61eb4621a7a371ca152dc4034445c6b7f188edb
parent7410208b72aa8cb163ebc60f4beac6f564dfcd49
Fix memory errors found by Alfredo with valgrind

BufferParams::setDocumentClass() deletes the old document class of the buffer
and creates a copy of the new one. Therefore, the stored layout pointers in
the paragraphs (actually only one paragraph exists) are dangling afterwards.
Resetting them before setting the document class helps here.
In the long term we need to get rid of BufferParams::setDocumentClass()
completely, this is very ugly.
src/CutAndPaste.cpp
status.21x