fix crash when using wxDataViewListStore::DeleteAllItems
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		@@ -986,7 +986,7 @@ public:
 | 
				
			|||||||
    void AppendItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
 | 
					    void AppendItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
 | 
				
			||||||
    void PrependItem( 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 InsertItem(  unsigned int row, const wxVector<wxVariant> &values, wxClientData *data = NULL );
 | 
				
			||||||
    void DeleteItem( unsigned pos );
 | 
					    void DeleteItem( unsigned int pos );
 | 
				
			||||||
    void DeleteAllItems();
 | 
					    void DeleteAllItems();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // override base virtuals
 | 
					    // override base virtuals
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1415,7 +1415,8 @@ void wxDataViewListStore::PrependItem( const wxVector<wxVariant> &values, wxClie
 | 
				
			|||||||
    RowPrepended();
 | 
					    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 );
 | 
					    wxDataViewListStoreLine *line = new wxDataViewListStoreLine( data );
 | 
				
			||||||
    line->m_values = values;
 | 
					    line->m_values = values;
 | 
				
			||||||
@@ -1424,7 +1425,7 @@ void wxDataViewListStore::InsertItem(  unsigned int row, const wxVector<wxVarian
 | 
				
			|||||||
    RowInserted( row );
 | 
					    RowInserted( row );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void wxDataViewListStore::DeleteItem( unsigned row )
 | 
					void wxDataViewListStore::DeleteItem( unsigned int row )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    wxVector<wxDataViewListStoreLine*>::iterator it = m_data.begin() + row;
 | 
					    wxVector<wxDataViewListStoreLine*>::iterator it = m_data.begin() + row;
 | 
				
			||||||
    m_data.erase( it );
 | 
					    m_data.erase( it );
 | 
				
			||||||
@@ -1441,6 +1442,8 @@ void wxDataViewListStore::DeleteAllItems()
 | 
				
			|||||||
        delete line;
 | 
					        delete line;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    m_data.clear();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Reset( 0 );
 | 
					    Reset( 0 );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user