Don't recreate the native control in wxOSX wxDataViewCtrl dtor.

Don't call ClearColumns() which recreates the control in order to remove its
columns in wxOSX/Cocoa, just clean up the internal data, the control, and its
columns, will soon be deleted anyhow.

Closes #16210.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76639 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-06-01 16:23:15 +00:00
parent f1f2ec9957
commit 10b7d587fa

View File

@ -349,7 +349,12 @@ void wxDataViewCustomRenderer::SetDC(wxDC* newDCPtr)
wxDataViewCtrl::~wxDataViewCtrl()
{
ClearColumns();
// Notice that we don't call ClearColumns() from here as with Cocoa this
// method actually recreates the entire control which is unnecessary when
// we're about to dsetroy it and results in unexpected side effects (e.g.
// calls to comparison function as the entire contents of the control is
// re-added to it and so possibly re-sorted).
WX_CLEAR_ARRAY(m_ColumnPtrs);
// Ensure that the already destructed controls is not notified about changes
// in the model any more.