Skip to content

Commit

Permalink
Merge pull request #1959 from Areloch/SDLSplashScreenCleanupSanity
Browse files Browse the repository at this point in the history
Does better sanity checking on cleanup for the splash screen closing in SDL
  • Loading branch information
Areloch committed Apr 3, 2018
1 parent 0f1d270 commit 840d53c
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions Engine/source/windowManager/sdl/sdlSplashScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,26 @@ bool Platform::displaySplashWindow( String path )

bool Platform::closeSplashWindow()
{
SDL_DestroyTexture(gSplashTexture);
SDL_FreeSurface(gSplashImage);
SDL_DestroyRenderer(gSplashRenderer);
SDL_DestroyWindow(gSplashWindow);
if (gSplashTexture != nullptr)
{
SDL_DestroyTexture(gSplashTexture);
gSplashTexture = nullptr;
}
if (gSplashImage != nullptr)
{
SDL_FreeSurface(gSplashImage);
gSplashImage = nullptr;
}
if (gSplashRenderer != nullptr)
{
SDL_DestroyRenderer(gSplashRenderer);
gSplashRenderer = nullptr;
}
if (gSplashWindow != nullptr)
{
SDL_DestroyWindow(gSplashWindow);
gSplashWindow = nullptr;
}

return true;
}

0 comments on commit 840d53c

Please sign in to comment.