fixed potential crash bug (accessing already destroyed SDL renderer)
authorHolger Schemel <info@artsoft.org>
Mon, 7 Jan 2019 15:20:39 +0000 (16:20 +0100)
committerHolger Schemel <info@artsoft.org>
Mon, 7 Jan 2019 15:37:48 +0000 (16:37 +0100)
This bug was caused by destroying textures after reinitializing the
window, which causes the SDL renderer to be destroyed and created
for the new window. Unfortunately, to destroy the old textures (which
were created using the previous renderer), the old renderer is used,
causing access to already free()'d memory.

To fix this bug, all textures are destroyed before the renderer is
destroyed (and re-created).

This bug caused regular crashes of the Windows version of the game
when switching between level sets that redefine the window size
(while no such crashes were observed with the Linux or Mac version).


No differences found