]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/scopedptr.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / scopedptr.h
index bfe98de16e5afc9c59f7b668e7b48bdd5b462b9e..5cc0c0770d5fa8b79b1b323f6747e63bcdd5106f 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     scoped smart pointer class
 // Author:      Jesse Lovelace <jllovela@eos.ncsu.edu>
 // Created:     06/01/02
-// RCS-ID:      $Id$
 // Copyright:   (c) Jesse Lovelace and original Boost authors (see below)
 //              (c) 2009 Vadim Zeitlin
 // Licence:     wxWindows licence
@@ -63,7 +62,7 @@ public:
     {
         if ( ptr != m_ptr )
         {
-            delete m_ptr;
+            wxCHECKED_DELETE(m_ptr);
             m_ptr = ptr;
         }
     }
@@ -129,14 +128,7 @@ public:                             \
                                     \
     ~name();                        \
                                     \
-    void reset(T * ptr = NULL)      \
-    {                               \
-        if (m_ptr != ptr)           \
-        {                           \
-            delete m_ptr;           \
-            m_ptr = ptr;            \
-        }                           \
-    }                               \
+    void reset(T * ptr = NULL);     \
                                     \
     T *release()                    \
     {                               \
@@ -171,6 +163,14 @@ public:                             \
 };
 
 #define wxDEFINE_SCOPED_PTR(T, name)\
+void name::reset(T * ptr)           \
+{                                   \
+    if (m_ptr != ptr)               \
+    {                               \
+        wxCHECKED_DELETE(m_ptr);    \
+        m_ptr = ptr;                \
+    }                               \
+}                                   \
 name::~name()                       \
 {                                   \
     wxCHECKED_DELETE(m_ptr);        \