diff --git a/include/wx/buffer.h b/include/wx/buffer.h index e3e1ac0e66..3be01fee36 100644 --- a/include/wx/buffer.h +++ b/include/wx/buffer.h @@ -245,10 +245,7 @@ public: } wxCharTypeBuffer(const wxCharTypeBuffer& src) - { - this->m_data = src.m_data; - this->IncRef(); - } + : wxScopedCharTypeBuffer(src) {} wxCharTypeBuffer& operator=(const CharType *str) { @@ -261,13 +258,7 @@ public: wxCharTypeBuffer& operator=(const wxCharTypeBuffer& src) { - if ( &src == this ) - return *this; - - this->DecRef(); - this->m_data = src.m_data; - this->IncRef(); - + wxScopedCharTypeBuffer::operator=(src); return *this; }