X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bf9a1615ed0d4a051d6165014c7a0b6636f9ed43..6d50049a5c4a04f10df683482b51e10c2d65ef84:/src/mac/carbon/utils.cpp diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index 8e7cf1af16..d491c42b04 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -863,12 +863,11 @@ void wxMacControl::Init() void wxMacControl::Dispose() { + wxASSERT_MSG( m_controlRef != NULL , wxT("Control Handle already NULL, Dispose called twice ?") ); wxASSERT_MSG( IsValidControlHandle(m_controlRef) , wxT("Invalid Control Handle (maybe already released) in Dispose") ); - CFIndex count = CFGetRetainCount( m_controlRef ) ; - wxASSERT_MSG( count == 1 , wxT("Reference Count of native control was not 1 in Dispose") ); - - ::DisposeControl( m_controlRef ); + // we cannot check the ref count here anymore, as autorelease objects might delete their refs later + CFRelease(m_controlRef); m_controlRef = NULL; }