]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/object.cpp
VTK wrapper of vtkRenderWindow for wxPython. Tested on MSW so far.
[wxWidgets.git] / src / common / object.cpp
index 44d3f3f3a6932f4658bc0837b797fce5a0851811..de51bf7c62f88236018a552510b28f6ecb1e50ef 100644 (file)
@@ -355,13 +355,15 @@ void wxObject::Ref(const wxObject& clone)
 
 void wxObject::UnRef()
 {
 
 void wxObject::UnRef()
 {
-    if (m_refData) {
-        assert(m_refData->m_count > 0);
-        --(m_refData->m_count);
-        if (m_refData->m_count == 0)
+    if ( m_refData )
+    {
+        wxASSERT_MSG( m_refData->m_count > 0, _T("invalid ref data count") );
+
+        if ( !--m_refData->m_count )
             delete m_refData;
             delete m_refData;
+
+        m_refData = (wxObjectRefData *) NULL;
     }
     }
-    m_refData = (wxObjectRefData *) NULL;
 }
 
 /*
 }
 
 /*