mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 15:23:48 +01:00
The new event filter works more safely with Destroy, not Close events
This commit is contained in:
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user