]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/buffer.h
translate "Copy URL" string in the popup menu (feature request 1803958) (should have...
[wxWidgets.git] / include / wx / buffer.h
index 81a445afe57bbc98a9c03039efdc37075691eeeb..d06fbf6fc15b57a76d726521cd9f4295621bd111 100644 (file)
@@ -105,9 +105,12 @@ public:
 
     wxCharTypeBuffer& operator=(const wxCharTypeBuffer& src)
     {
-        if ( m_owned )
-            free(m_str);
-        CopyFrom(src);
+        if (&src != this)
+        {
+            if ( m_owned )
+                free(m_str);
+            CopyFrom(src);
+        }
         return *this;
     }
 
@@ -317,9 +320,12 @@ public:
 
     wxMemoryBuffer& operator=(const wxMemoryBuffer& src)
     {
-        m_bufdata->DecRef();
-        m_bufdata = src.m_bufdata;
-        m_bufdata->IncRef();
+        if (&src != this)
+        {
+            m_bufdata->DecRef();
+            m_bufdata = src.m_bufdata;
+            m_bufdata->IncRef();
+        }
         return *this;
     }