]> git.saurik.com Git - wxWidgets.git/commitdiff
check for self-assignment in operator=
authorPaul Cornett <paulcor@bullseye.com>
Sat, 21 Feb 2009 18:08:40 +0000 (18:08 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Sat, 21 Feb 2009 18:08:40 +0000 (18:08 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59074 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/fontutil.h

index 3efd2d1e2c9ad86f19d31558b07d036708442df9..4c4b6a7bbeb7e0daec287f782a3a8ea6562988f3 100644 (file)
@@ -143,8 +143,11 @@ public:
 
     wxNativeFontInfo& operator=(const wxNativeFontInfo& info)
     {
-        Free();
-        Init(info);
+        if (this != &info)
+        {
+            Free();
+            Init(info);
+        }
         return *this;
     }
 #endif // wxUSE_PANGO