Cleanup: remove some unnecessary includes.
[dcpomatic.git] / src / wx / fonts_dialog.cc
index b21bb8498653af24e9ae817c5cf8ad9e1fee6d31..c59607e8f4cd1b906c6a392403fbaf59a8b4d519 100644 (file)
@@ -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<wxFileDialog>(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<SystemFontDialog>(this);
        if (dialog->ShowModal() == wxID_OK) {
                auto font_file = dialog->get_font();
                if (font_file) {