Commit 9f74a780 authored by Stephen Anthony's avatar Stephen Anthony
Browse files

Fix crash when FrameBuffer message surfaces haven't been created.

The next task is to move all FrameBuffer message-related functionality into its own class.
parent bf5a9e57
Pipeline #10806 passed with stages
in 2 minutes and 12 seconds
......@@ -67,10 +67,6 @@ FrameBuffer::FrameBuffer(OSystem& osystem)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FrameBuffer::~FrameBuffer()
{
// Make sure to free surfaces/textures before destroying the backend itself
// Most platforms are fine with doing this in either order, but it seems
// that OpenBSD in particular crashes when attempting to destroy textures
// *after* the renderer is already destroyed
cerr << "~FrameBuffer()" << endl << endl;
}
......@@ -256,21 +252,7 @@ FBInitStatus FrameBuffer::createDisplay(const string& title, BufferType type,
return FBInitStatus::FailTooLarge;
#endif
// Initialize video mode handler, so it can know what video modes are
// appropriate for the requested image size
myVidModeHandler.setImageSize(size);
// Always save, maybe only the mode of the window has changed
saveCurrentWindowPosition();
myBufferType = type;
// Initialize video subsystem
string pre_about = myBackend->about();
FBInitStatus status = applyVideoMode();
if(status != FBInitStatus::Success)
return status;
#ifdef GUI_SUPPORT
#ifdef GUI_SUPPORT // TODO: put message stuff in its own class
// Erase any messages from a previous run
myMsg.enabled = false;
......@@ -297,6 +279,20 @@ FBInitStatus FrameBuffer::createDisplay(const string& title, BufferType type,
}
#endif
// Initialize video mode handler, so it can know what video modes are
// appropriate for the requested image size
myVidModeHandler.setImageSize(size);
// Always save, maybe only the mode of the window has changed
saveCurrentWindowPosition();
myBufferType = type;
// Initialize video subsystem
string pre_about = myBackend->about();
FBInitStatus status = applyVideoMode();
if(status != FBInitStatus::Success)
return status;
// Print initial usage message, but only print it later if the status has changed
if(myInitializedCount == 1)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment