diff --git a/include/wx/osx/core/private.h b/include/wx/osx/core/private.h index ddc5701bc2..4a2662bbe4 100644 --- a/include/wx/osx/core/private.h +++ b/include/wx/osx/core/private.h @@ -343,6 +343,7 @@ public : FindBestFromWXWidget(WXWidget control); static void RemoveAssociations( wxWidgetImpl* impl); + static void RemoveAssociation(WXWidget control); static void Associate( WXWidget control, wxWidgetImpl *impl ); diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index 9a7d9a8a08..af7780a4c0 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -2084,6 +2084,7 @@ bool wxCocoaDataViewControl::ClearColumns() // as there is a bug in NSOutlineView version (OSX 10.5.6 #6555162) the // columns cannot be deleted if there is an outline column in the view; // therefore, the whole view is deleted and newly constructed: + RemoveAssociation(m_OutlineView); // undo InitOutlineView's association [m_OutlineView release]; m_OutlineView = [[wxCocoaOutlineView alloc] init]; [((NSScrollView*) GetWXWidget()) setDocumentView:m_OutlineView]; diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index 97acee559d..f02518526d 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -2739,6 +2739,13 @@ void wxWidgetImpl::RemoveAssociations(wxWidgetImpl* impl) } } +void wxWidgetImpl::RemoveAssociation(WXWidget control) +{ + wxCHECK_RET( control != NULL, wxT("attempt to remove a NULL WXWidget from control map") ); + + wxWinMacControlList.erase(control); +} + wxIMPLEMENT_ABSTRACT_CLASS(wxWidgetImpl, wxObject); wxWidgetImpl::wxWidgetImpl( wxWindowMac* peer , bool isRootControl, bool isUserPane )