#include "wx/chartype.h"
#include "wx/wxcrtbase.h"
+#ifndef __WXPALMOS5__
#include <stdlib.h> // malloc() and free()
+#endif // ! __WXPALMOS5__
class WXDLLIMPEXP_FWD_BASE wxCStrData;
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;
}
// type of the value returned by wxString::utf8_str()
#if wxUSE_UNICODE_UTF8
- #define wxUTF8Buf wxCharBuffer
-#else
#define wxUTF8Buf char *
+#else
+ #define wxUTF8Buf wxCharBuffer
#endif
// ----------------------------------------------------------------------------
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;
}