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
This commit is contained in:
Václav Slavík 2010-05-06 05:43:01 +00:00
parent bdd6a03de7
commit ba5619e076

View File

@ -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); \