Use wxList::DeleteContents() to delete columns
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53775 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4057,15 +4057,12 @@ wxDataViewCtrl::~wxDataViewCtrl()
|
|||||||
if (m_notifier)
|
if (m_notifier)
|
||||||
GetModel()->RemoveNotifier( m_notifier );
|
GetModel()->RemoveNotifier( m_notifier );
|
||||||
|
|
||||||
wxDataViewColumnList::const_iterator iter;
|
m_cols.Clear();
|
||||||
for (iter = m_cols.begin(); iter!=m_cols.end(); iter++)
|
|
||||||
{
|
|
||||||
delete *iter;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDataViewCtrl::Init()
|
void wxDataViewCtrl::Init()
|
||||||
{
|
{
|
||||||
|
m_cols.DeleteContents(true);
|
||||||
m_notifier = NULL;
|
m_notifier = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4242,7 +4239,6 @@ bool wxDataViewCtrl::DeleteColumn( wxDataViewColumn *column )
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_cols.Erase(ret);
|
m_cols.Erase(ret);
|
||||||
delete column;
|
|
||||||
OnColumnChange();
|
OnColumnChange();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -4250,7 +4246,7 @@ bool wxDataViewCtrl::DeleteColumn( wxDataViewColumn *column )
|
|||||||
|
|
||||||
bool wxDataViewCtrl::ClearColumns()
|
bool wxDataViewCtrl::ClearColumns()
|
||||||
{
|
{
|
||||||
m_cols.clear();
|
m_cols.Clear();
|
||||||
OnColumnChange();
|
OnColumnChange();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user