]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/cmndata.h
fixed memory leak in wxXmlResource introduced when fixing wxVector<> usage (patch...
[wxWidgets.git] / include / wx / cmndata.h
index 3ecfc402a8a1c51729a0e39a5142b532cd26f75e..630415f4c359b166405906d506265c0abb003dee 100644 (file)
@@ -37,7 +37,7 @@ public:
 
     wxColourData();
     wxColourData(const wxColourData& data);
-    void operator=(const wxColourData&);
+    wxColourData& operator=(const wxColourData& data);
     virtual ~wxColourData();
 
     void SetChooseFull(bool flag) { m_chooseFull = flag; }
@@ -87,17 +87,20 @@ public:
 
     wxFontData& operator=(const wxFontData& data)
     {
-        wxObject::operator=(data);
-        m_fontColour     = data.m_fontColour;
-        m_showHelp       = data.m_showHelp;
-        m_allowSymbols   = data.m_allowSymbols;
-        m_enableEffects  = data.m_enableEffects;
-        m_initialFont    = data.m_initialFont;
-        m_chosenFont     = data.m_chosenFont;
-        m_minSize        = data.m_minSize;
-        m_maxSize        = data.m_maxSize;
-        m_encoding       = data.m_encoding;
-        m_encodingInfo   = data.m_encodingInfo;
+        if (&data != this)
+        {
+            wxObject::operator=(data);
+            m_fontColour     = data.m_fontColour;
+            m_showHelp       = data.m_showHelp;
+            m_allowSymbols   = data.m_allowSymbols;
+            m_enableEffects  = data.m_enableEffects;
+            m_initialFont    = data.m_initialFont;
+            m_chosenFont     = data.m_chosenFont;
+            m_minSize        = data.m_minSize;
+            m_maxSize        = data.m_maxSize;
+            m_encoding       = data.m_encoding;
+            m_encodingInfo   = data.m_encodingInfo;
+        }
         return *this;
     }