X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ffonts_dialog.cc;h=c59607e8f4cd1b906c6a392403fbaf59a8b4d519;hb=e87f943433216d294b22853411eca5c582be1066;hp=b21bb8498653af24e9ae817c5cf8ad9e1fee6d31;hpb=5800e1f2abecb709cbdc1408d1328f29cdbcb370;p=dcpomatic.git diff --git a/src/wx/fonts_dialog.cc b/src/wx/fonts_dialog.cc index b21bb8498..c59607e8f 100644 --- a/src/wx/fonts_dialog.cc +++ b/src/wx/fonts_dialog.cc @@ -184,8 +184,7 @@ FontsDialog::set_from_file_clicked () default_dir = "/System/Library/Fonts"; #endif - auto d = new wxFileDialog (this, _("Choose a font file"), default_dir, wxT(""), wxT("*.ttf;*.otf;*.ttc"), wxFD_CHANGE_DIR); - ScopeGuard sg = [d]() { d->Destroy(); }; + auto d = make_wx(this, _("Choose a font file"), default_dir, wxT(""), wxT("*.ttf;*.otf;*.ttc"), wxFD_CHANGE_DIR); if (d->ShowModal() != wxID_OK) { return; @@ -204,8 +203,7 @@ FontsDialog::set_from_system_font_clicked() return; } - auto dialog = new SystemFontDialog(this); - ScopeGuard sg = [dialog]() { dialog->Destroy(); }; + auto dialog = make_wx(this); if (dialog->ShowModal() == wxID_OK) { auto font_file = dialog->get_font(); if (font_file) {