From: Vadim Zeitlin Date: Wed, 15 May 2013 21:45:25 +0000 (+0000) Subject: Fix wxXmlNode self-assignment. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9b237f109cd17f0ab7c509cdc08fb6688ca1a708?ds=sidebyside 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 --- diff --git a/src/xml/xml.cpp b/src/xml/xml.cpp index 6e2dbf6c96..0fc27c246b 100644 --- a/src/xml/xml.cpp +++ b/src/xml/xml.cpp @@ -97,8 +97,12 @@ wxXmlNode::~wxXmlNode() wxXmlNode& wxXmlNode::operator=(const wxXmlNode& node) { - DoFree(); - DoCopy(node); + if ( &node != this ) + { + DoFree(); + DoCopy(node); + } + return *this; }