wxCharTypeBuffer& operator=(const wxCharTypeBuffer& src)
{
- if ( m_owned )
- free(m_str);
- CopyFrom(src);
+ if (&src != this)
+ {
+ if ( m_owned )
+ free(m_str);
+ CopyFrom(src);
+ }
return *this;
}
wxMemoryBuffer& operator=(const wxMemoryBuffer& src)
{
- m_bufdata->DecRef();
- m_bufdata = src.m_bufdata;
- m_bufdata->IncRef();
+ if (&src != this)
+ {
+ m_bufdata->DecRef();
+ m_bufdata = src.m_bufdata;
+ m_bufdata->IncRef();
+ }
return *this;
}