More stack-allocated Dialog objects.
[dcpomatic.git] / src / wx / language_tag_dialog.cc
index a3ad847d52b9c98d6bb375d3b69811f15ee47859..b472edab07d1a5fda88d417129b23189ebe5b833 100644 (file)
@@ -75,13 +75,11 @@ LanguageTagDialog::LanguageTagDialog (wxWindow* parent, dcp::LanguageTag tag)
 void
 LanguageTagDialog::add_language ()
 {
-       auto full = new FullLanguageTagDialog (GetParent());
-       auto r = full->ShowModal ();
-       if (r == wxID_OK) {
-               Config::instance()->add_custom_language (full->get());
-               set (full->get());
+       FullLanguageTagDialog full(GetParent());
+       if (full.ShowModal() == wxID_OK) {
+               Config::instance()->add_custom_language(full.get());
+               set(full.get());
        }
-       full->Destroy ();
 }