From f8a6f0cd39c55aeeb5ed293eb9be47a80dfe9102 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 18 Dec 2023 16:49:35 +0100 Subject: [PATCH] Initialize wxFileDialog::m_data in default ctor in wxMSW too This corrects a problem introduced in 11ed91af8f (Add missing default constructor of wxFileDialog in wxMSW, 2023-12-03) as m_data remained uninitialized when default ctor was used. See #24113. --- include/wx/msw/filedlg.h | 2 +- src/msw/filedlg.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/wx/msw/filedlg.h b/include/wx/msw/filedlg.h index 090c3e2418..7c97723dd7 100644 --- a/include/wx/msw/filedlg.h +++ b/include/wx/msw/filedlg.h @@ -79,7 +79,7 @@ private: // Extra data, possibly null if not needed, use MSWData() to access it if // it should be created on demand. - wxFileDialogMSWData* m_data; + wxFileDialogMSWData* m_data = nullptr; wxDECLARE_DYNAMIC_CLASS(wxFileDialog); diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index f685688a63..75a0b46012 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -1024,8 +1024,6 @@ wxFileDialog::wxFileDialog(wxWindow *parent, { // NB: all style checks are done by wxFileDialogBase::Create - m_data = nullptr; - // Must set to zero, otherwise the wx routines won't size the window // the second time you call the file dialog, because it thinks it is // already at the requested size.. (when centering)