]> git.saurik.com Git - wxWidgets.git/commitdiff
fix crash when using wxDataViewListStore::DeleteAllItems
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Fri, 6 Mar 2009 00:01:11 +0000 (00:01 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Fri, 6 Mar 2009 00:01:11 +0000 (00:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/dataview.h
src/common/datavcmn.cpp

index 2f81131449fdddd353b8ad6da13b60755ca3f327..9b82fe23c7844e8e60287e07af48480df2e29ae3 100644 (file)
@@ -986,7 +986,7 @@ public:
     void AppendItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
     void PrependItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
     void InsertItem(  unsigned int row, const wxVector<wxVariant> &values, wxClientData *data = NULL );
-    void DeleteItem( unsigned pos );
+    void DeleteItem( unsigned int pos );
     void DeleteAllItems();
 
     // override base virtuals
index 74021deb9899d79e2eb63132c4a942e5cd3c89f4..17f3e911d34e8b5173df39bf45e26ff0379d0912 100644 (file)
@@ -1415,7 +1415,8 @@ void wxDataViewListStore::PrependItem( const wxVector<wxVariant> &values, wxClie
     RowPrepended();
 }
 
-void wxDataViewListStore::InsertItem(  unsigned int row, const wxVector<wxVariant> &values, wxClientData *data )
+void wxDataViewListStore::InsertItem(  unsigned int row, const wxVector<wxVariant> &values, 
+                                       wxClientData *data )
 {
     wxDataViewListStoreLine *line = new wxDataViewListStoreLine( data );
     line->m_values = values;
@@ -1424,7 +1425,7 @@ void wxDataViewListStore::InsertItem(  unsigned int row, const wxVector<wxVarian
     RowInserted( row );
 }
 
-void wxDataViewListStore::DeleteItem( unsigned row )
+void wxDataViewListStore::DeleteItem( unsigned int row )
 {
     wxVector<wxDataViewListStoreLine*>::iterator it = m_data.begin() + row;
     m_data.erase( it );
@@ -1441,6 +1442,8 @@ void wxDataViewListStore::DeleteAllItems()
         delete line;
     }
 
+    m_data.clear();
+
     Reset( 0 );
 }