Fix bug when a wxToolBar tool is deleted from its click handler

Deleting a tool from its own event handler resulted in at least in an assert
and could also lead to a crash as an already deallocated pointer was
dereferenced.

Fix this by checking if the tool with the same ID is still available after the
event handler finishes.

Closes #16762.

(this is a backport of faffaaae29 from master)
This commit is contained in:
Artur Wieczorek
2015-09-01 18:45:30 +02:00
committed by Vadim Zeitlin
parent 234f081527
commit f239eba7b0
2 changed files with 12 additions and 0 deletions

View File

@@ -628,6 +628,7 @@ wxMSW:
- Fix wxDV_ROW_LINES in horizontally scrolled wxDataViewCtrl.
- Fix RegisterHotKey() with negative IDs (troelsk).
- Fix event object type for wxEVT_SPINCTRL events.
- Fix bug if wxToolBar tool was deleted from its own handler (Artur Wieczorek).
wxOSX: