From b4256aa4e2ae6d1f4b01d192cc6ed32bf99cf611 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 6 Mar 2023 18:49:54 +0000 Subject: [PATCH] Initialize wxAppConsoleBase members in their declaration No real changes, just initialize member variables immediately in the declaration instead of doing it in the ctor in a different file. --- include/wx/app.h | 10 +++++----- src/common/appbase.cpp | 4 ---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/include/wx/app.h b/include/wx/app.h index 87ab2d052a..acb7acea85 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -502,13 +502,13 @@ protected: m_appDisplayName, // app display name ("My Application") m_className; // class name - // the class defining the application behaviour, nullptr initially and created - // by GetTraits() when first needed - wxAppTraits *m_traits; + // allows customizing the application behaviour, created by GetTraits() + // when first needed + wxAppTraits *m_traits = nullptr; // the main event loop of the application (may be null if the loop hasn't // been started yet or has already terminated) - wxEventLoopBase *m_mainLoop; + wxEventLoopBase *m_mainLoop = nullptr; // pending events management vars: @@ -529,7 +529,7 @@ protected: #endif // flag modified by Suspend/ResumeProcessingOfPendingEvents() - bool m_bDoPendingEventProcessing; + bool m_bDoPendingEventProcessing = true; friend class WXDLLIMPEXP_FWD_BASE wxEvtHandler; diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index 2ce0050244..85c8a0cd94 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -134,10 +134,6 @@ wxDEFINE_TIED_SCOPED_PTR_TYPE(wxEventLoopBase) wxAppConsoleBase::wxAppConsoleBase() { - m_traits = nullptr; - m_mainLoop = nullptr; - m_bDoPendingEventProcessing = true; - ms_appInstance = reinterpret_cast(this); #ifdef __WXDEBUG__