Fix wxXmlNode self-assignment.

Don't lose the node contents if it's assigned to itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73992 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-05-15 21:45:25 +00:00
parent 52e4cd7308
commit 9b237f109c

View File

@@ -96,9 +96,13 @@ wxXmlNode::~wxXmlNode()
} }
wxXmlNode& wxXmlNode::operator=(const wxXmlNode& node) wxXmlNode& wxXmlNode::operator=(const wxXmlNode& node)
{
if ( &node != this )
{ {
DoFree(); DoFree();
DoCopy(node); DoCopy(node);
}
return *this; return *this;
} }