Combine return statements in OPENGL_GAL::CheckFeatures

This commit is contained in:
Roberto Fernandez Bautista 2020-10-30 18:58:26 +00:00
parent 24a4f06013
commit 6c07ebe5f2
1 changed files with 7 additions and 6 deletions

View File

@ -321,8 +321,11 @@ void OPENGL_GAL::PostPaint( wxPaintEvent& aEvent )
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();
@ -336,15 +339,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;
}