Use wx_ptr more.
[dcpomatic.git] / src / wx / kdm_cpl_panel.cc
index b1bbc1cf01d6d711aef38f0665f6a146474d3be3..1ddaa90cf5097159251bec6f4e56caf05efd5091 100644 (file)
@@ -101,17 +101,14 @@ KDMCPLPanel::update_cpl_summary ()
 void
 KDMCPLPanel::cpl_browse_clicked ()
 {
-       wxFileDialog* d = new wxFileDialog (this, _("Select CPL XML file"), wxEmptyString, wxEmptyString, "*.xml");
+       auto d = make_wx<wxFileDialog>(this, _("Select CPL XML file"), wxEmptyString, wxEmptyString, "*.xml");
        if (d->ShowModal() == wxID_CANCEL) {
-               d->Destroy ();
                return;
        }
 
        boost::filesystem::path cpl_file (wx_to_std (d->GetPath ()));
        boost::filesystem::path dcp_dir = cpl_file.parent_path ();
 
-       d->Destroy ();
-
        try {
                /* XXX: hack alert */
                cxml::Document cpl_document ("CompositionPlaylist");