From 8c981ec64d9a86e9bad5f4ef16f496513bce31f6 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Fri, 8 Sep 2006 08:27:32 +0000 Subject: [PATCH] make sure we catch invalid control refs better git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41064 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/utils.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index 240161a190..3824110a77 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -826,6 +826,11 @@ void wxMacControl::Init() void wxMacControl::Dispose() { + 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 ); m_controlRef = NULL; } -- 2.47.2