summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-05-22 23:26:55 +0000
committerCarl Hetherington <cth@carlh.net>2019-05-22 23:26:55 +0000
commit67bd9c7a2fad1568ac10b771a76a601937c20174 (patch)
tree4ef9cf0b0e8a8a76d6b8551e36574ec064cdaa4d
parentdaed95a3c8ac52f301bf331da4951b7e98cb50b6 (diff)
More destruction of the splash screen.v2.14.4
-rw-r--r--src/tools/dcpomatic.cc25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 048d5fedd..3ba9ceb9d 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -1455,20 +1455,20 @@ public:
App ()
: wxApp ()
, _frame (0)
+ , _splash (0)
{}
private:
bool OnInit ()
{
- wxSplashScreen* splash = 0;
try {
wxInitAllImageHandlers ();
Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this));
Config::Warning.connect (boost::bind (&App::config_warning, this, _1));
- splash = maybe_show_splash ();
+ _splash = maybe_show_splash ();
SetAppName (_("DCP-o-matic"));
@@ -1511,9 +1511,9 @@ private:
_frame = new DOMFrame (_("DCP-o-matic"));
SetTopWindow (_frame);
_frame->Maximize ();
- if (splash) {
- splash->Destroy ();
- splash = 0;
+ if (_splash) {
+ _splash->Destroy ();
+ _splash = 0;
}
if (!Config::instance()->nagged(Config::NAG_INITIAL_SETUP)) {
@@ -1558,8 +1558,8 @@ private:
}
catch (exception& e)
{
- if (splash) {
- splash->Destroy ();
+ if (_splash) {
+ _splash->Destroy ();
}
error_dialog (0, wxString::Format ("DCP-o-matic could not start."), std_to_wx(e.what()));
}
@@ -1598,6 +1598,11 @@ private:
void report_exception ()
{
+ if (_splash) {
+ _splash->Destroy ();
+ _splash = 0;
+ }
+
try {
throw;
} catch (FileError& e) {
@@ -1666,6 +1671,11 @@ private:
return false;
}
+ if (_splash) {
+ _splash->Destroy ();
+ _splash = 0;
+ }
+
RecreateChainDialog* d = new RecreateChainDialog (_frame);
int const r = d->ShowModal ();
d->Destroy ();
@@ -1673,6 +1683,7 @@ private:
}
DOMFrame* _frame;
+ wxSplashScreen* _splash;
shared_ptr<wxTimer> _timer;
string _film_to_load;
string _film_to_create;