From ddfbff357f3b4d13674a39615a10725156a45935 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 4 Nov 2007 21:24:23 +0000 Subject: [PATCH] avoiding refcount checks under Leopard, the behaviour differs there git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@49630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/toolbar.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mac/carbon/toolbar.cpp b/src/mac/carbon/toolbar.cpp index cdccd09634..959911d37b 100644 --- a/src/mac/carbon/toolbar.cpp +++ b/src/mac/carbon/toolbar.cpp @@ -129,7 +129,11 @@ public: if ( m_toolbarItemRef ) { CFIndex count = CFGetRetainCount( m_toolbarItemRef ) ; - wxASSERT_MSG( count == 1 , wxT("Reference Count of native tool was not 1 in wxToolBarTool destructor") ); + // different behaviour under Leopard + if ( UMAGetSystemVersion() < 0x1050 ) + { + wxASSERT_MSG( count == 1 , wxT("Reference Count of native tool was not 1 in wxToolBarTool destructor") ); + } wxTheApp->MacAddToAutorelease(m_toolbarItemRef); CFRelease(m_toolbarItemRef); m_toolbarItemRef = NULL; @@ -892,8 +896,11 @@ wxToolBar::~wxToolBar() MacInstallNativeToolbar( false ); CFIndex count = CFGetRetainCount( m_macHIToolbarRef ) ; - wxASSERT_MSG( count == 1 , wxT("Reference Count of native control was not 1 in wxToolBar destructor") ); - + // Leopard seems to have one refcount more, so we cannot check reliably at the moment + if ( UMAGetSystemVersion() < 0x1050 ) + { + wxASSERT_MSG( count == 1 , wxT("Reference Count of native control was not 1 in wxToolBar destructor") ); + } CFRelease( (HIToolbarRef)m_macHIToolbarRef ); m_macHIToolbarRef = NULL; }