1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-18 09:00:52 +02:00

The new event filter works more safely with Destroy, not Close events

This commit is contained in:
Paul Licameli 2017-07-23 16:01:10 -04:00
parent 67b858ed3f
commit 3b0a113525

View File

@ -663,8 +663,8 @@ int ToolManager::FilterEvent(wxEvent &event)
top == mParent )
mLastFocus = window;
}
else if (event.GetEventType() == wxEVT_CLOSE_WINDOW) {
auto &closeEvent = static_cast<wxCloseEvent&>(event);
else if (event.GetEventType() == wxEVT_DESTROY) {
auto &closeEvent = static_cast<wxWindowDestroyEvent&>(event);
auto window = closeEvent.GetEventObject();
if (window == mLastFocus)
// Avoid a dangling pointer!