Fix crash when deleting items in wxTreeListCtrl
An invalid pointer was dereferenced after being deleted as ToDVI(item) checked the item parent, i.e. used it, even though the item was already invalid. Closes #17198.
This commit is contained in:
@@ -589,6 +589,7 @@ Unix:
|
||||
All (GUI):
|
||||
|
||||
- Fix hang when deleting columns from wxTreeListCtrl.
|
||||
- Fix crash when deleting items from wxTreeListCtrl (Rexxar).
|
||||
- Allow requesting modern (3.x+) OpenGL version in wxGLCanvas (Fabio Arnold).
|
||||
- Allow using Ctrl-dragging to add to selection in wxGrid (Knut Petter Lehre).
|
||||
- Fix several floating point rounding bugs in wxPropertyGrid (Artur Wieczorek).
|
||||
|
@@ -743,7 +743,10 @@ void wxTreeListModel::DeleteItem(Node* item)
|
||||
previous->DeleteNext();
|
||||
}
|
||||
|
||||
ItemDeleted(ToDVI(parent), ToDVI(item));
|
||||
// Note that the item is already deleted by now, so we can't use it in any
|
||||
// way, e.g. by calling ToDVI(item) which does dereference the pointer, but
|
||||
// ToNonRootDVI() that we use here does not.
|
||||
ItemDeleted(ToDVI(parent), ToNonRootDVI(item));
|
||||
}
|
||||
|
||||
void wxTreeListModel::DeleteAllItems()
|
||||
|
Reference in New Issue
Block a user