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:
parent
bdd6a03de7
commit
ba5619e076
@ -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); \
|
||||
|
Loading…
Reference in New Issue
Block a user