video: point destroyed textures to NULL
When a renderer gets destroyed, all associated textures get destroyed as well, so point them to NULL to prevent them being destroyed again.
This commit is contained in:
parent
1f07cbb796
commit
05c3023d2b
1 changed files with 3 additions and 0 deletions
|
|
@ -1239,6 +1239,9 @@ static void SetVideoMode(void)
|
|||
if (renderer != NULL)
|
||||
{
|
||||
SDL_DestroyRenderer(renderer);
|
||||
// all associated textures get destroyed
|
||||
texture = NULL;
|
||||
texture_upscaled = NULL;
|
||||
}
|
||||
|
||||
renderer = SDL_CreateRenderer(screen, -1, renderer_flags);
|
||||
|
|
|
|||
Loading…
Reference in a new issue