Fix ItemDeleted() call in wxTreeListModel.
While it doesn't matter when exactly do we call it with the generic or GTK native implementations, under OS X we must update the internal model first and call this method afterwards because it refreshes the control contents immediately and so was calling back to the model and getting the pointer to the item about to be deleted, which resulted in a crash when this pointer was dereferences later. Closes #15575. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75044 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
1662725c75
commit
7915eea7a6
@ -716,8 +716,6 @@ void wxTreeListModel::DeleteItem(Node* item)
|
||||
|
||||
Node* const parent = item->GetParent();
|
||||
|
||||
ItemDeleted(ToDVI(parent), ToDVI(item));
|
||||
|
||||
Node* previous = parent->GetChild();
|
||||
if ( previous == item )
|
||||
{
|
||||
@ -739,6 +737,8 @@ void wxTreeListModel::DeleteItem(Node* item)
|
||||
|
||||
previous->DeleteNext();
|
||||
}
|
||||
|
||||
ItemDeleted(ToDVI(parent), ToDVI(item));
|
||||
}
|
||||
|
||||
void wxTreeListModel::DeleteAllItems()
|
||||
|
Loading…
Reference in New Issue
Block a user