diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-01-16 01:14:37 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-01-16 01:15:50 +0100 |
| commit | fe851f2e6e57d3a8781ecc173089c19632c521e3 (patch) | |
| tree | fd0f388d9ce9eccb4a8011361bd166d192918bd8 /src/wx/audio_panel.cc | |
| parent | e8748f158249d7be906f6c6cf2411df45dd07a24 (diff) | |
Use wx_ptr more.
Diffstat (limited to 'src/wx/audio_panel.cc')
| -rw-r--r-- | src/wx/audio_panel.cc | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc index f84c9d67f..81a445efb 100644 --- a/src/wx/audio_panel.cc +++ b/src/wx/audio_panel.cc @@ -195,14 +195,6 @@ AudioPanel::add_to_grid () } -AudioPanel::~AudioPanel () -{ - if (_audio_dialog) { - _audio_dialog->Destroy (); - _audio_dialog = nullptr; - } -} - void AudioPanel::film_changed (Film::Property property) { @@ -424,17 +416,14 @@ AudioPanel::setup_sensitivity () void AudioPanel::show_clicked () { - if (_audio_dialog) { - _audio_dialog->Destroy (); - _audio_dialog = nullptr; - } + _audio_dialog.reset(); auto ac = _parent->selected_audio (); if (ac.size() != 1) { return; } - _audio_dialog = new AudioDialog (this, _parent->film(), _parent->film_viewer(), ac.front()); + _audio_dialog.reset(this, _parent->film(), _parent->film_viewer(), ac.front()); _audio_dialog->Show (); } @@ -533,10 +522,7 @@ void AudioPanel::set_film (shared_ptr<Film>) { /* We are changing film, so destroy any audio dialog for the old one */ - if (_audio_dialog) { - _audio_dialog->Destroy (); - _audio_dialog = nullptr; - } + _audio_dialog.reset(); } |
