From b3a3c9d82cc02f82470540af195c215886c66e9f Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Tue, 27 May 2008 09:19:41 +0000 Subject: [PATCH] Use wxList::DeleteContents() to delete columns git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53775 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/datavgen.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 0d226bf965..458c83373e 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -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; } -- 2.45.2