diff options
Diffstat (limited to 'src/wx/screen_dialog.cc')
| -rw-r--r-- | src/wx/screen_dialog.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc index 1f1fc2fad..6d7fb4f03 100644 --- a/src/wx/screen_dialog.cc +++ b/src/wx/screen_dialog.cc @@ -272,12 +272,12 @@ ScreenDialog::get_recipient_from_file () void ScreenDialog::download_recipient () { - auto d = new DownloadCertificateDialog (this); - if (d->ShowModal() == wxID_OK) { - set_recipient (d->certificate()); - checked_set (_recipient_file, d->url()); + auto dialog = new DownloadCertificateDialog (this); + ScopeGuard sg = [dialog]() { dialog->Destroy(); }; + if (dialog->ShowModal() == wxID_OK) { + set_recipient(dialog->certificate()); + checked_set(_recipient_file, dialog->url()); } - d->Destroy (); setup_sensitivity (); } |
