#include "dcpomatic_button.h"
#include "fonts_dialog.h"
#include "system_font_dialog.h"
+#include "wx_ptr.h"
#include "wx_util.h"
#include "lib/content.h"
#include "lib/font.h"
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;
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) {