- if (bitmap.LoadFile(bitmap_path("splash"), wxBITMAP_TYPE_PNG)) {
- wxMemoryDC dc(bitmap);
- auto const version = wxString::Format("%s (%s)", dcpomatic_version, dcpomatic_git_commit);
- auto screen_size = dc.GetSize();
- auto text_size = dc.GetTextExtent(version);
- dc.DrawText(version, (screen_size.GetWidth() - text_size.GetWidth()) / 2, 236);
+ if (bitmap.LoadFile(bitmap_path("splash.png"), wxBITMAP_TYPE_PNG)) {
+ {
+ /* This wxMemoryDC must be destroyed before bitmap can be used elsewhere */
+ wxMemoryDC dc(bitmap);
+ auto const version = wxString::Format("%s (%s)", dcpomatic_version, dcpomatic_git_commit);
+ auto screen_size = dc.GetSize();
+ auto text_size = dc.GetTextExtent(version);
+ dc.DrawText(version, (screen_size.GetWidth() - text_size.GetWidth()) / 2, 236);
+ }