1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Destroy gameScreen after all other graphics are destroyed

This is because destroying the renderer causes use-after-frees since the
renderer destroys all textures when it gets destroyed.

This fixes a Valgrind error where an invalid read occurs because the
font textures get destroyed again after the renderer is destroyed.
This commit is contained in:
Misa 2023-03-03 16:46:15 -08:00
parent faff8bba5f
commit 33fa0750be

View file

@ -823,9 +823,9 @@ static void cleanup(void)
graphics.grphx.destroy(); graphics.grphx.destroy();
graphics.destroy_buffers(); graphics.destroy_buffers();
gameScreen.destroy();
graphics.destroy(); graphics.destroy();
font::destroy(); font::destroy();
gameScreen.destroy();
music.destroy(); music.destroy();
map.destroy(); map.destroy();
NETWORK_shutdown(); NETWORK_shutdown();