check for self-assignment in operator=

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59074 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2009-02-21 18:08:40 +00:00
parent 50de831a51
commit b04237742c

View File

@@ -143,8 +143,11 @@ public:
wxNativeFontInfo& operator=(const wxNativeFontInfo& info) wxNativeFontInfo& operator=(const wxNativeFontInfo& info)
{ {
Free(); if (this != &info)
Init(info); {
Free();
Init(info);
}
return *this; return *this;
} }
#endif // wxUSE_PANGO #endif // wxUSE_PANGO