mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +00:00
Does better sanity checking on cleanup for the splash screen closing with SDL. Could erroneously get called a second time and if we'd already cleared the images and textures, it could crash.
This fixes that.
This commit is contained in:
parent
5c8a82180b
commit
c91c900e19
1 changed files with 20 additions and 4 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue