X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5cd99866132366b74289e5a08e963723732bae01..105993f7b6baf97b596d09e9c59c42adcee0dbcf:/include/wx/osx/core/cfref.h diff --git a/include/wx/osx/core/cfref.h b/include/wx/osx/core/cfref.h index eb6adeeee0..cb4f636498 100644 --- a/include/wx/osx/core/cfref.h +++ b/include/wx/osx/core/cfref.h @@ -234,9 +234,12 @@ public: */ wxCFRef& operator=(const wxCFRef& otherRef) { - wxCFRetain(otherRef.m_ptr); - wxCFRelease(m_ptr); - m_ptr = otherRef.m_ptr; + if (this != &otherRef) + { + wxCFRetain(otherRef.m_ptr); + wxCFRelease(m_ptr); + m_ptr = otherRef.m_ptr; + } return *this; }