Combine return statements in OPENGL_GAL::CheckFeatures

This commit is contained in:
Roberto Fernandez Bautista 2020-10-30 18:58:26 +00:00 committed by Seth Hillbrand
parent 4314e4dc93
commit 33385d0bb0
1 changed files with 7 additions and 6 deletions

View File

@ -327,8 +327,11 @@ OPENGL_GAL::~OPENGL_GAL()
wxString OPENGL_GAL::CheckFeatures( GAL_DISPLAY_OPTIONS& aOptions )
{
wxString retVal = wxEmptyString;
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 );
testFrame->Raise();
@ -342,15 +345,13 @@ wxString OPENGL_GAL::CheckFeatures( GAL_DISPLAY_OPTIONS& aOptions )
catch( std::runtime_error& err )
{
//Test failed
delete opengl_gal;
delete testFrame;
return wxString( err.what() );
retVal = wxString( err.what() );
}
//Test passed
delete opengl_gal;
delete testFrame;
return wxEmptyString;
return retVal;
}