summaryrefslogtreecommitdiff
path: root/src/wx/wx_util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-15 01:25:27 +0100
committerCarl Hetherington <cth@carlh.net>2023-01-15 01:25:27 +0100
commit963c7649da903b87637975e8c2d634da887d3109 (patch)
treeab59391e9f4fd5a35f4bec052b97d4e703b007cd /src/wx/wx_util.cc
parentfcaf62b405f6379e7030ddc2a38426c5f9ffb081 (diff)
Use wx_ptr for the splash screen.
Diffstat (limited to 'src/wx/wx_util.cc')
-rw-r--r--src/wx/wx_util.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index d264f8b20..e600b63c8 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -537,10 +537,11 @@ setup_audio_channels_choice (wxChoice* choice, int minimum)
}
-wxSplashScreen *
+wx_ptr<wxSplashScreen>
maybe_show_splash ()
{
- wxSplashScreen* splash = nullptr;
+ wx_ptr<wxSplashScreen> splash;
+
try {
wxBitmap bitmap;
if (bitmap.LoadFile(bitmap_path("splash.png"), wxBITMAP_TYPE_PNG)) {
@@ -554,9 +555,9 @@ maybe_show_splash ()
}
#ifdef DCPOMATIC_WINDOWS
/* Having wxSTAY_ON_TOP means error dialogues hide behind the splash screen on Windows, no matter what I try */
- splash = new wxSplashScreen (bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, 0, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE | wxFRAME_NO_TASKBAR);
+ splash.reset(bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, nullptr, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE | wxFRAME_NO_TASKBAR);
#else
- splash = new wxSplashScreen (bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, 0, -1);
+ splash.reset(bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, nullptr, -1);
#endif
wxYield ();
}