diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-01-27 13:41:49 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-01-27 13:41:49 +0100 |
| commit | 7aab34abcab28ca38a5354dec075b56d430e82db (patch) | |
| tree | a7a02355bb4ea08cdf652ccb89b4ee6d1247b5dd /src/wx/file_picker_ctrl.cc | |
| parent | 526829ad670c19d5466555890d8afe8d7f744834 (diff) | |
More stack-allocated Dialog objects.
Diffstat (limited to 'src/wx/file_picker_ctrl.cc')
| -rw-r--r-- | src/wx/file_picker_ctrl.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/wx/file_picker_ctrl.cc b/src/wx/file_picker_ctrl.cc index 284f7bc99..bf4877891 100644 --- a/src/wx/file_picker_ctrl.cc +++ b/src/wx/file_picker_ctrl.cc @@ -83,12 +83,11 @@ FilePickerCtrl::browse_clicked () if (_warn_overwrite) { style |= wxFD_OVERWRITE_PROMPT; } - wxFileDialog* d = new wxFileDialog (this, _prompt, wxEmptyString, wxEmptyString, _wildcard, style); - d->SetPath (_path); - if (d->ShowModal () == wxID_OK) { - SetPath (d->GetPath ()); + wxFileDialog dialog(this, _prompt, wxEmptyString, wxEmptyString, _wildcard, style); + dialog.SetPath(_path); + if (dialog.ShowModal() == wxID_OK) { + SetPath(dialog.GetPath()); } - d->Destroy (); } void |
