From 80ce14910ce22220dd7f7e3d12c77781359d215a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 7 Sep 2023 01:28:19 +0200 Subject: [PATCH] Initialize wxWebViewChromium members in their declarations No real changes, but ensure that all of them are always initialized. --- include/wx/webview_chromium.h | 10 +++++----- src/common/webview_chromium.cpp | 5 ----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/include/wx/webview_chromium.h b/include/wx/webview_chromium.h index 26520af88e..dc20c894f2 100644 --- a/include/wx/webview_chromium.h +++ b/include/wx/webview_chromium.h @@ -136,13 +136,13 @@ private: //History related variables, we currently use our own implementation wxVector > m_historyList; - int m_historyPosition; - bool m_historyLoadingFromList; - bool m_historyEnabled; + int m_historyPosition = -1; + bool m_historyLoadingFromList = false; + bool m_historyEnabled = true; //We need to store the title and zoom ourselves wxString m_title; - wxWebViewZoom m_zoomLevel; + wxWebViewZoom m_zoomLevel = wxWEBVIEW_ZOOM_MEDIUM; // Current main frame page source wxString m_pageSource; @@ -155,7 +155,7 @@ private: // We also friend wxCEFClientHandler so it can access m_implData. friend class wxCEF::ClientHandler; - wxCEF::ClientHandler* m_clientHandler; + wxCEF::ClientHandler* m_clientHandler = nullptr; friend class wxWebViewChromiumModule; static bool ms_cefInitialized; diff --git a/src/common/webview_chromium.cpp b/src/common/webview_chromium.cpp index 3ae59a4c3f..7e766f4636 100644 --- a/src/common/webview_chromium.cpp +++ b/src/common/webview_chromium.cpp @@ -398,11 +398,6 @@ bool wxWebViewChromium::Create(wxWindow* parent, MSWDisableComposited(); #endif // __WXMSW__ - m_historyLoadingFromList = false; - m_historyEnabled = true; - m_historyPosition = -1; - m_zoomLevel = wxWEBVIEW_ZOOM_MEDIUM; - m_implData = new ImplData{}; m_clientHandler = new ClientHandler{*this};