From 3b0a113525ad5a4c283592c3450e73d86fad9b1d Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 23 Jul 2017 16:01:10 -0400 Subject: [PATCH] The new event filter works more safely with Destroy, not Close events --- src/toolbars/ToolManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/toolbars/ToolManager.cpp b/src/toolbars/ToolManager.cpp index 9628d0a0b..c24686073 100644 --- a/src/toolbars/ToolManager.cpp +++ b/src/toolbars/ToolManager.cpp @@ -663,8 +663,8 @@ int ToolManager::FilterEvent(wxEvent &event) top == mParent ) mLastFocus = window; } - else if (event.GetEventType() == wxEVT_CLOSE_WINDOW) { - auto &closeEvent = static_cast(event); + else if (event.GetEventType() == wxEVT_DESTROY) { + auto &closeEvent = static_cast(event); auto window = closeEvent.GetEventObject(); if (window == mLastFocus) // Avoid a dangling pointer!