summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-08-28 11:52:02 +0100
committerCarl Hetherington <cth@carlh.net>2015-08-28 11:52:02 +0100
commit3cb5a75e730c44025bb02d540ced8f66276a9b98 (patch)
treec9b7495f9dc185d0392892f9c0c3f6cdd1b8d496 /src
parentd48d93178bf9ffa18dbbbc4e0540fdd3085eb430 (diff)
Don't crash on startup if the splash PNG can't be found.
Diffstat (limited to 'src')
-rw-r--r--src/tools/dcpomatic.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 1ab316fec..e2465ea4a 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -798,13 +798,17 @@ private:
wxInitAllImageHandlers ();
wxSplashScreen* splash = 0;
- if (!Config::have_existing ()) {
- wxBitmap bitmap;
- boost::filesystem::path p = shared_path () / "splash.png";
- if (bitmap.LoadFile (std_to_wx (p.string ()), wxBITMAP_TYPE_PNG)) {
- splash = new wxSplashScreen (bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, 0, -1);
- wxYield ();
+ try {
+ if (!Config::have_existing ()) {
+ wxBitmap bitmap;
+ boost::filesystem::path p = shared_path () / "splash.png";
+ if (bitmap.LoadFile (std_to_wx (p.string ()), wxBITMAP_TYPE_PNG)) {
+ splash = new wxSplashScreen (bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, 0, -1);
+ wxYield ();
+ }
}
+ } catch (boost::filesystem::filesystem_error& e) {
+ /* Maybe we couldn't find the splash image; never mind */
}
SetAppName (_("DCP-o-matic"));