]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/object.cpp
test for timegm() added
[wxWidgets.git] / src / common / object.cpp
index 44d3f3f3a6932f4658bc0837b797fce5a0851811..d70fdbd253b892e765869bfb8af542d410f5bc3e 100644 (file)
@@ -275,7 +275,6 @@ wxObject *wxCreateDynamicObject(const wxChar *name)
         }
         return (wxObject*) NULL;
     }
-    return (wxObject*) NULL;
 }
 
 #if wxUSE_SERIAL
@@ -355,13 +354,15 @@ void wxObject::Ref(const wxObject& clone)
 
 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;
+
+        m_refData = (wxObjectRefData *) NULL;
     }
-    m_refData = (wxObjectRefData *) NULL;
 }
 
 /*