]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/sharedptr.h
Don't create multiple parent-less top level frames in layout sample.
[wxWidgets.git] / include / wx / sharedptr.h
index 5bfd215136e22640647b746b1a6b5acf16185151..290c610adce601592b5ced87307ad880191590db 100644 (file)
@@ -3,7 +3,7 @@
 // Purpose:     Shared pointer based on the counted_ptr<> template, which
 //              is in the public domain
 // Author:      Robert Roebling, Yonat Sharon
-// RCS-ID:      $Id: object.h 47254 2007-07-09 10:09:52Z VS $
+// RCS-ID:      $Id$
 // Copyright:   Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -115,8 +115,7 @@ private:
     {
         if (m_ref)
         {
-            wxAtomicDec( m_ref->m_count );
-            if (m_ref->m_count == 0)
+            if (!wxAtomicDec( m_ref->m_count ))
             {
                 delete m_ref->m_ptr;
                 delete m_ref;