From 960c259905a51217a41126098ab84da2f2fd03d9 Mon Sep 17 00:00:00 2001 From: codereader Date: Sun, 11 Apr 2021 19:47:27 +0200 Subject: [PATCH] #5586: Fix crash at shutdown in wxMSW due to the wxAuiManager not unregistering itself from the managed window --- radiant/ui/mainframe/AuiLayout.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/radiant/ui/mainframe/AuiLayout.cpp b/radiant/ui/mainframe/AuiLayout.cpp index a73d1f8d67..16bc39852a 100644 --- a/radiant/ui/mainframe/AuiLayout.cpp +++ b/radiant/ui/mainframe/AuiLayout.cpp @@ -158,6 +158,13 @@ void AuiLayout::deactivate() GlobalGroupDialog().hideDialogWindow(); GlobalGroupDialog().removePage("textures"); // do this after destroyWindow() + + // Unregister the AuiMgr from the event handlers of the managed window + // otherwise we run into crashes during shutdown (#5586) + _auiMgr.UnInit(); + + // Dispose of the managed window + delete _auiMgr.GetManagedWindow(); } void AuiLayout::restoreStateFromRegistry()