X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic.cc;h=af4576fd5e2daeee848eebc2ed981e00e185c136;hp=546306ac4d89bf2f6a42d6a094453aa86f13c2f1;hb=963c7649da903b87637975e8c2d634da887d3109;hpb=fcaf62b405f6379e7030ddc2a38426c5f9ffb081 diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 546306ac4..af4576fd5 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -1728,10 +1728,7 @@ private: } catch (exception& e) { - if (_splash) { - _splash->Destroy (); - _splash = nullptr; - } + _splash.reset(); error_dialog (nullptr, wxString::Format ("DCP-o-matic could not start."), std_to_wx(e.what())); } @@ -1843,10 +1840,7 @@ private: void close_splash () { - if (_splash) { - _splash->Destroy (); - _splash = nullptr; - } + _splash.reset(); } void config_failed_to_load (Config::LoadFailure what) @@ -1864,8 +1858,7 @@ private: /* Destroy the splash screen here, as otherwise bad things seem to happen (for reasons unknown) when we open our recreate dialog, close it, *then* try to Destroy the splash (the Destroy fails). */ - _splash->Destroy (); - _splash = nullptr; + _splash.reset(); auto config = Config::instance(); switch (reason) { @@ -1934,7 +1927,7 @@ private: } DOMFrame* _frame = nullptr; - wxSplashScreen* _splash = nullptr; + wx_ptr _splash; shared_ptr _timer; string _film_to_load; string _film_to_create;