From 612507550b58d15a5e1eccba4ff84a1cd126d068 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 2 Jul 2023 23:51:55 +0200 Subject: Fix crash if an exception is thrown before the splash screen is created. --- src/tools/dcpomatic.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index fc568d737..b53f39b45 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -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 _timer; string _film_to_load; string _film_to_create; -- cgit v1.2.3