diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-02-25 01:53:48 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-02-25 01:54:22 +0100 |
| commit | 9f150f04c8fce17dbcbe11278dd78c6e35809aa2 (patch) | |
| tree | dc4c36254282b9152b9ff04dc09f07dc1e6ba0f1 /src/tools | |
| parent | 674b74173d2d0ec8e178fa0938a4c48c2863c38b (diff) | |
Fix misunderstanding of wxDialog lifetime handling.2978-wxptr-crash
Broken by d0308d53dd9f4d036d8c5fe8023920fcdfd43f39
wxDialog can be stack allocated if opened with ShowModal(), but not with
Show(). Go back to wx_ptr for those that are opened with Show().
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 7048781e3..3d9d571af 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -876,7 +876,7 @@ private: return; } - _kdm_dialog.emplace(this, _film); + _kdm_dialog.reset(this, _film); _kdm_dialog->Show (); } @@ -886,7 +886,7 @@ private: return; } - _dkdm_dialog.emplace(this, _film); + _dkdm_dialog.reset(this, _film); _dkdm_dialog->Show (); } @@ -1083,7 +1083,7 @@ private: void view_video_waveform () { if (!_video_waveform_dialog) { - _video_waveform_dialog.emplace(this, _film, _film_viewer); + _video_waveform_dialog.reset(this, _film, _film_viewer); } _video_waveform_dialog->Show (); @@ -1130,7 +1130,7 @@ private: void tools_manage_templates () { if (!_templates_dialog) { - _templates_dialog.emplace(this); + _templates_dialog.reset(this); } _templates_dialog->Show (); @@ -1578,15 +1578,15 @@ private: wxPanel* _right_panel; FilmViewer _film_viewer; StandardControls* _controls; - boost::optional<VideoWaveformDialog> _video_waveform_dialog; + wx_ptr<VideoWaveformDialog> _video_waveform_dialog; SystemInformationDialog* _system_information_dialog = nullptr; DCPReferencingDialog* _dcp_referencing_dialog = nullptr; HintsDialog* _hints_dialog = nullptr; ServersListDialog* _servers_list_dialog = nullptr; wxPreferencesEditor* _config_dialog = nullptr; - boost::optional<KDMDialog> _kdm_dialog; - boost::optional<DKDMDialog> _dkdm_dialog; - boost::optional<TemplatesDialog> _templates_dialog; + wx_ptr<KDMDialog> _kdm_dialog; + wx_ptr<DKDMDialog> _dkdm_dialog; + wx_ptr<TemplatesDialog> _templates_dialog; wxMenu* _file_menu = nullptr; shared_ptr<Film> _film; int _history_items = 0; |
