]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/osx/core/cfref.h
Increase interoperability between wxPoint and wxRealPoint introducing constructors...
[wxWidgets.git] / include / wx / osx / core / cfref.h
index eb6adeeee03f22f67c19ff473f611bc084a5ea47..cb4f6364986b02f800125a951d35a03f73a41e9c 100644 (file)
@@ -234,9 +234,12 @@ public:
     */
     wxCFRef& operator=(const wxCFRef& otherRef)
     {
-        wxCFRetain(otherRef.m_ptr);
-        wxCFRelease(m_ptr);
-        m_ptr = otherRef.m_ptr;
+        if (this != &otherRef)
+        {
+            wxCFRetain(otherRef.m_ptr);
+            wxCFRelease(m_ptr);
+            m_ptr = otherRef.m_ptr;
+        }
         return *this;
     }