X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4e0c592f98541952291b5da3add924f6ce4dd1b6..7344108e8a129a3f9b4df5ab0f98a1713db03b89:/include/wx/scopedptr.h diff --git a/include/wx/scopedptr.h b/include/wx/scopedptr.h index bfe98de16e..f31a4ef036 100644 --- a/include/wx/scopedptr.h +++ b/include/wx/scopedptr.h @@ -63,7 +63,7 @@ public: { if ( ptr != m_ptr ) { - delete m_ptr; + wxCHECKED_DELETE(m_ptr); m_ptr = ptr; } } @@ -129,14 +129,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 +164,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); \