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:
parent
52e4cd7308
commit
9b237f109c
1 changed files with 6 additions and 2 deletions
|
|
@ -97,8 +97,12 @@ wxXmlNode::~wxXmlNode()
|
|||
|
||||
wxXmlNode& wxXmlNode::operator=(const wxXmlNode& node)
|
||||
{
|
||||
DoFree();
|
||||
DoCopy(node);
|
||||
if ( &node != this )
|
||||
{
|
||||
DoFree();
|
||||
DoCopy(node);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue