Wrap CTOR in try/catch for context errors

This commit is contained in:
Seth Hillbrand 2021-01-28 10:55:24 -08:00
parent 50b05aea4a
commit 945faba586
1 changed files with 6 additions and 4 deletions

View File

@ -332,13 +332,15 @@ wxString OPENGL_GAL::CheckFeatures( GAL_DISPLAY_OPTIONS& aOptions )
wxFrame* testFrame = new wxFrame( NULL, wxID_ANY, wxT( "" ), wxDefaultPosition, wxSize( 1, 1 ),
wxFRAME_TOOL_WINDOW | wxNO_BORDER );
KIGFX::OPENGL_GAL* opengl_gal = new KIGFX::OPENGL_GAL( aOptions, testFrame );
KIGFX::OPENGL_GAL* opengl_gal = nullptr;
try
{
opengl_gal = new KIGFX::OPENGL_GAL( aOptions, testFrame );
testFrame->Raise();
testFrame->Show();
try
{
GAL_CONTEXT_LOCKER lock( opengl_gal );
opengl_gal->init();
}