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:
parent
67b858ed3f
commit
3b0a113525
@ -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!
|
||||
|
Loading…
x
Reference in New Issue
Block a user