Correct wxObjectDataPtr<> assignment from *T to not increase the ref count

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51076 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2008-01-07 15:12:46 +00:00
parent a27555e453
commit e39d30c05b
3 changed files with 21 additions and 6 deletions

View File

@@ -456,7 +456,12 @@ public:
}
T *get() const { return m_ptr; }
T *operator->() const { return get(); }
T *operator->() const
{
wxASSERT(m_ptr != NULL);
return get();
}
void reset(T *ptr)
{
@@ -480,8 +485,6 @@ public:
if (m_ptr)
m_ptr->DecRef();
m_ptr = ptr;
if (m_ptr)
m_ptr->IncRef();
return *this;
}