~wxToolBarTool()
{
ClearControl();
- if ( m_controlHandle )
- DisposeControl( m_controlHandle );
#if wxMAC_USE_NATIVE_TOOLBAR
if ( m_toolbarItemRef )
void ClearControl()
{
m_control = NULL;
+ if ( m_controlHandle )
+ {
+ DisposeControl( m_controlHandle );
+ m_controlHandle = NULL ;
+ }
#if wxMAC_USE_NATIVE_TOOLBAR
m_toolbarItemRef = NULL;
case wxTOOL_STYLE_SEPARATOR:
if ( tool->GetControlHandle() )
{
- DisposeControl( (ControlRef) tool->GetControlHandle() );
-
#if wxMAC_USE_NATIVE_TOOLBAR
if ( removeIndex != -1 && m_macHIToolbarRef )
{