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:
@@ -97,8 +97,12 @@ wxXmlNode::~wxXmlNode()
|
||||
|
||||
wxXmlNode& wxXmlNode::operator=(const wxXmlNode& node)
|
||||
{
|
||||
DoFree();
|
||||
DoCopy(node);
|
||||
if ( &node != this )
|
||||
{
|
||||
DoFree();
|
||||
DoCopy(node);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user