Fix memory leak in wxXmlNode::operator=().

We must delete all children and attributes in the node being overwritten and
not just the first one of each.

Add a unit test exercising this code to be able to check that valgrind doesn't
report memory leak any more after the fix.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-05-15 20:01:58 +00:00
parent 5181927e6b
commit 0b3e395a5c
3 changed files with 52 additions and 8 deletions

View File

@@ -216,6 +216,7 @@ private:
int m_lineNo; // line number in original file, or -1
bool m_noConversion; // don't do encoding conversion - node is plain text
void DoFree();
void DoCopy(const wxXmlNode& node);
};