diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-04-25 11:03:54 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-04-25 11:03:56 +0200 |
| commit | 293f82daa07bbc357940e5dd214f7c534bab0a86 (patch) | |
| tree | fb604e1508c04e31336c0c121afadc0662369686 /src/wx/wx_util.cc | |
| parent | e87f943433216d294b22853411eca5c582be1066 (diff) | |
Don't use wx_ptr for the splash screen.
Using wx_ptr in the wxApp object seems bad because in ~App wxWidgets
deletes all top-level windows in `DeleteAllTLWs` so if ~wx_ptr then
tries to destroy them we get a use-after-free.
Diffstat (limited to 'src/wx/wx_util.cc')
| -rw-r--r-- | src/wx/wx_util.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 7a41f66e7..f36bcdf25 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -537,10 +537,10 @@ setup_audio_channels_choice (wxChoice* choice, int minimum) } -wx_ptr<wxSplashScreen> +wxSplashScreen* maybe_show_splash () { - wx_ptr<wxSplashScreen> splash; + wxSplashScreen* splash; try { wxBitmap bitmap; @@ -555,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.reset(bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, nullptr, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE | wxFRAME_NO_TASKBAR); + splash = new wxSplashScreen(bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, nullptr, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE | wxFRAME_NO_TASKBAR); #else - splash.reset(bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, nullptr, -1); + splash = new wxSplashScreen(bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, nullptr, -1); #endif wxYield (); } |
