made wxCharTypeBuffer<T>::release() const again, for compatibility
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55067 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
0654c03aff
commit
03af437f75
@ -59,7 +59,10 @@ public:
|
|||||||
DecRef();
|
DecRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
CharType *release()
|
// NB: this method is only const for backward compatibility. It used to
|
||||||
|
// be needed for auto_ptr-like semantics of the copy ctor, but now
|
||||||
|
// that ref-counting is used, it's not really needed.
|
||||||
|
CharType *release() const
|
||||||
{
|
{
|
||||||
if ( m_data == &NullData )
|
if ( m_data == &NullData )
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -68,8 +71,11 @@ public:
|
|||||||
wxASSERT_MSG( m_data->m_ref == 1, _T("can't release shared buffer") );
|
wxASSERT_MSG( m_data->m_ref == 1, _T("can't release shared buffer") );
|
||||||
|
|
||||||
CharType *p = m_data->m_str;
|
CharType *p = m_data->m_str;
|
||||||
m_data->m_str = NULL;
|
|
||||||
DecRef();
|
wxCharTypeBuffer *self = wx_const_cast(wxCharTypeBuffer*, this);
|
||||||
|
self->m_data->m_str = NULL;
|
||||||
|
self->DecRef();
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user