]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/object.cpp
don't compile this file under wxMSW
[wxWidgets.git] / src / common / object.cpp
index 96f54f4277e4f2b8edc3b894b1d7cc66e2dfec8a..7bf7dbdc112fe194ecb8e9e339b9be670e0ecbc0 100644 (file)
@@ -230,6 +230,10 @@ void wxObject::Ref(const wxObject& clone)
     DEBUG_PRINTF(wxObject::Ref)
 #endif
 
     DEBUG_PRINTF(wxObject::Ref)
 #endif
 
+    // nothing to be done
+    if (m_refData == clone.m_refData)
+        return;
+
     // delete reference to old data
     UnRef();
 
     // delete reference to old data
     UnRef();
 
@@ -262,7 +266,7 @@ void wxObject::AllocExclusive()
     else if ( m_refData->GetRefCount() > 1 )
     {
         // note that ref is not going to be destroyed in this case
     else if ( m_refData->GetRefCount() > 1 )
     {
         // note that ref is not going to be destroyed in this case
-        wxObjectRefData* ref = m_refData;
+        const wxObjectRefData* ref = m_refData;
         UnRef();
 
         // ... so we can still access it
         UnRef();
 
         // ... so we can still access it
@@ -282,7 +286,8 @@ wxObjectRefData *wxObject::CreateRefData() const
     return NULL;
 }
 
     return NULL;
 }
 
-wxObjectRefData *wxObject::CloneRefData(wxObjectRefData * WXUNUSED(data)) const
+wxObjectRefData *
+wxObject::CloneRefData(const wxObjectRefData * WXUNUSED(data)) const
 {
     // if you use AllocExclusive() you must override this method
     wxFAIL_MSG( _T("CloneRefData() must be overridden if called!") );
 {
     // if you use AllocExclusive() you must override this method
     wxFAIL_MSG( _T("CloneRefData() must be overridden if called!") );