Fix crash if an exception is thrown before the splash screen is created.
authorCarl Hetherington <cth@carlh.net>
Sun, 2 Jul 2023 21:51:55 +0000 (23:51 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 2 Jul 2023 21:51:55 +0000 (23:51 +0200)
src/tools/dcpomatic.cc

index fc568d737e360fdfcdf8204027ba924527abb350..b53f39b451ab3aca2cede112d120e283ad135d75 100644 (file)
@@ -1821,8 +1821,10 @@ private:
 
        void close_splash ()
        {
-               _splash->Destroy();
-               _splash = nullptr;
+               if (_splash) {
+                       _splash->Destroy();
+                       _splash = nullptr;
+               }
        }
 
        void config_failed_to_load (Config::LoadFailure what)
@@ -1909,7 +1911,7 @@ private:
        }
 
        DOMFrame* _frame = nullptr;
-       wxSplashScreen* _splash;
+       wxSplashScreen* _splash = nullptr;
        shared_ptr<wxTimer> _timer;
        string _film_to_load;
        string _film_to_create;