]> git.lyx.org Git - features.git/commit
Fix memory errors found by Alfredo with valgrind
authorGeorg Baum <baum@lyx.org>
Tue, 11 Nov 2014 06:42:54 +0000 (07:42 +0100)
committerGeorg Baum <baum@lyx.org>
Tue, 11 Nov 2014 19:57:25 +0000 (20:57 +0100)
commit5deaaa3b137c7055bab66134c3e32c1777988253
tree7369452004e6f0d4e6ce5ee868d3b53f3522ee31
parent8f93600d3fa8182ba43973075cf37e7ecb2be8d3
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