Handmade Hero»Forums»Code
Mevius
13 posts
Love dark theme. Use it for everything. OS, browser, webpages, IDE, desktop background.
ESC crashes the game?
Edited by Mevius on Reason: Initial post
I compile the code and press ESC instinctively to exit, it crashes immediately. In release build, it break on line 2364 in handmade_opengl.cpp

What happened here?
263 posts / 1 project
None
ESC crashes the game?
@areriff,

I was able to reproduce this. Pressing the ESC key will end up destroying the hero in the brain logic. Later, in UpdateAndRenderWorld, if no heroes exist then PlayTitleScreen is called. PlayTitleSceen ends up freeing the memory_arena's data (via SetGameMode). At this point there is still a render_entry_lighting_transfer entry on the command queue, albeit with corrupted data. When OpenGLRenderCommands attempts to read that data the program crashes.

Not sure if this is a known bug or not.

~x13pixels