Merge pull request #1959 from Areloch/SDLSplashScreenCleanupSanity

Does better sanity checking on cleanup for the splash screen closing in SDL
This commit is contained in:
Areloch 2017-03-05 02:06:22 -06:00 committed by GitHub
commit 22fdf566fe

View file

@ -103,10 +103,26 @@ bool Platform::displaySplashWindow( String path )
bool Platform::closeSplashWindow() bool Platform::closeSplashWindow()
{ {
SDL_DestroyTexture(gSplashTexture); if (gSplashTexture != nullptr)
SDL_FreeSurface(gSplashImage); {
SDL_DestroyRenderer(gSplashRenderer); SDL_DestroyTexture(gSplashTexture);
SDL_DestroyWindow(gSplashWindow); 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; return true;
} }