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.
This commit is contained in:
Vadim Zeitlin 2023-12-18 16:49:35 +01:00
parent eabaec546b
commit f8a6f0cd39
2 changed files with 1 additions and 3 deletions

View file

@ -79,7 +79,7 @@ private:
// Extra data, possibly null if not needed, use MSWData() to access it if // Extra data, possibly null if not needed, use MSWData() to access it if
// it should be created on demand. // it should be created on demand.
wxFileDialogMSWData* m_data; wxFileDialogMSWData* m_data = nullptr;
wxDECLARE_DYNAMIC_CLASS(wxFileDialog); wxDECLARE_DYNAMIC_CLASS(wxFileDialog);

View file

@ -1024,8 +1024,6 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
{ {
// NB: all style checks are done by wxFileDialogBase::Create // 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 // 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 // the second time you call the file dialog, because it thinks it is
// already at the requested size.. (when centering) // already at the requested size.. (when centering)