mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 17:10:55 +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 )
|
top == mParent )
|
||||||
mLastFocus = window;
|
mLastFocus = window;
|
||||||
}
|
}
|
||||||
else if (event.GetEventType() == wxEVT_CLOSE_WINDOW) {
|
else if (event.GetEventType() == wxEVT_DESTROY) {
|
||||||
auto &closeEvent = static_cast<wxCloseEvent&>(event);
|
auto &closeEvent = static_cast<wxWindowDestroyEvent&>(event);
|
||||||
auto window = closeEvent.GetEventObject();
|
auto window = closeEvent.GetEventObject();
|
||||||
if (window == mLastFocus)
|
if (window == mLastFocus)
|
||||||
// Avoid a dangling pointer!
|
// Avoid a dangling pointer!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user