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)
|
||||
GetModel()->RemoveNotifier( m_notifier );
|
||||
|
||||
wxDataViewColumnList::const_iterator iter;
|
||||
for (iter = m_cols.begin(); iter!=m_cols.end(); iter++)
|
||||
{
|
||||
delete *iter;
|
||||
}
|
||||
m_cols.Clear();
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::Init()
|
||||
{
|
||||
m_cols.DeleteContents(true);
|
||||
m_notifier = NULL;
|
||||
}
|
||||
|
||||
@@ -4237,12 +4234,11 @@ void wxDataViewCtrl::ColumnMoved( wxDataViewColumn* col, unsigned int new_pos )
|
||||
|
||||
bool wxDataViewCtrl::DeleteColumn( wxDataViewColumn *column )
|
||||
{
|
||||
wxDataViewColumnList::compatibility_iterator ret = m_cols.Find( column );
|
||||
wxDataViewColumnList::compatibility_iterator ret = m_cols.Find( column );
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
m_cols.Erase(ret);
|
||||
delete column;
|
||||
OnColumnChange();
|
||||
|
||||
return true;
|
||||
@@ -4250,7 +4246,7 @@ bool wxDataViewCtrl::DeleteColumn( wxDataViewColumn *column )
|
||||
|
||||
bool wxDataViewCtrl::ClearColumns()
|
||||
{
|
||||
m_cols.clear();
|
||||
m_cols.Clear();
|
||||
OnColumnChange();
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user