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/audio_panel.cc | |
| parent | 526829ad670c19d5466555890d8afe8d7f744834 (diff) | |
More stack-allocated Dialog objects.
Diffstat (limited to 'src/wx/audio_panel.cc')
| -rw-r--r-- | src/wx/audio_panel.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc index 81a445efb..9a9043669 100644 --- a/src/wx/audio_panel.cc +++ b/src/wx/audio_panel.cc @@ -304,18 +304,17 @@ AudioPanel::film_content_changed (int property) void AudioPanel::gain_calculate_button_clicked () { - auto d = new GainCalculatorDialog (this); - auto const r = d->ShowModal (); - auto c = d->db_change(); + GainCalculatorDialog dialog(this); + auto const r = dialog.ShowModal(); + auto change = dialog.db_change(); - if (r == wxID_CANCEL || !c) { - d->Destroy (); + if (r == wxID_CANCEL || !change) { return; } auto old_peak_dB = peak (); auto old_value = _gain->wrapped()->GetValue(); - _gain->wrapped()->SetValue(old_value + *c); + _gain->wrapped()->SetValue(old_value + *change); /* This appears to be necessary, as the change is not signalled, I think. @@ -328,8 +327,6 @@ AudioPanel::gain_calculate_button_clicked () _gain->wrapped()->SetValue (old_value); _gain->view_changed (); } - - d->Destroy (); } |
