From: Václav Slavík Date: Thu, 6 May 2010 05:43:01 +0000 (+0000) Subject: Move wxScopedPtr::reset() implementation to wxDEFINE_SCOPED_PTR. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ba5619e07600355a9823f9d2dcfab56cdcbbfb07 Move wxScopedPtr::reset() implementation to wxDEFINE_SCOPED_PTR. Just as the destructor, reset() calls delete on T pointer and so can only be defined when T is fully defined. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/scopedptr.h b/include/wx/scopedptr.h index 8faa383c89..f31a4ef036 100644 --- a/include/wx/scopedptr.h +++ b/include/wx/scopedptr.h @@ -129,14 +129,7 @@ public: \ \ ~name(); \ \ - void reset(T * ptr = NULL) \ - { \ - if (m_ptr != ptr) \ - { \ - wxCHECKED_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); \