François Gannaz committed cb8dc57

MemLeak: text lines were never freed as the snapshot was never deleted

According to Valgrind, every line read in a document and added to
QDocumentPrivate.m_lines was a memory leak.
The problem was that these lines were also added to a document snapshot
and that list was not destroyed when the document was closed, so
the lines were still refered to and the memory could not be reclaimed.

  • Participants
  • Parent commits 5b3d8c5

Comments (0)

Files changed (1)

File latexdocument.cpp

 	if (!todoList->parent) delete todoList;
 	if (!bibTeXList->parent) delete bibTeXList;
 	if (!blockList->parent) delete blockList;
+	foreach (QDocumentLineHandle *dlh, mLineSnapshot) {
+		dlh->deref();
+	}
+	mLineSnapshot.clear();
 	delete baseStructure;