From a7aea0febfeb6f842fbca7186bfd96b80c91bd11 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 30 Jan 2024 21:07:29 +0100 Subject: [PATCH] Do common wxApp cleanup before port-specific part in all ports Some ports called wxAppBase::CleanUp() before performing port-specific cleanup, while some did it afterwards. The former seems preferable, as some actions performed in wxAppBase (such as showing log dialogs) may not work any more after the port-specific cleanup is done, while there should be no dependencies in the other direction. So standardize on calling wxAppBase version first in all ports, which also makes them more consistent with each other. --- src/gtk/app.cpp | 4 ++-- src/osx/carbon/app.cpp | 5 +++-- src/x11/app.cpp | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 8537b4f8cf..b8604051f5 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -568,6 +568,8 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_) void wxApp::CleanUp() { + wxAppBase::CleanUp(); + if (m_idleSourceId != 0) g_source_remove(m_idleSourceId); @@ -577,8 +579,6 @@ void wxApp::CleanUp() g_type_class_unref(gt); gdk_threads_leave(); - - wxAppBase::CleanUp(); } void wxApp::WakeUpIdle() diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index eba9652e47..0683e8dc40 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -358,13 +358,14 @@ int wxApp::OnRun() void wxApp::CleanUp() { wxMacAutoreleasePool autoreleasepool; + + wxAppBase::CleanUp(); + #if wxUSE_TOOLTIPS wxToolTip::RemoveToolTips() ; #endif DoCleanUp(); - - wxAppBase::CleanUp(); } //---------------------------------------------------------------------- diff --git a/src/x11/app.cpp b/src/x11/app.cpp index 4558c98207..9da804569e 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -198,10 +198,10 @@ bool wxApp::Initialize(int& argC, wxChar **argV) void wxApp::CleanUp() { + wxAppBase::CleanUp(); + wxDELETE(wxWidgetHashTable); wxDELETE(wxClientWidgetHashTable); - - wxAppBase::CleanUp(); } wxApp::wxApp()