Handmade Hero » Forums » Code » ESC crashes the game?
areriff
Mevius
13 posts

Love dark theme. Use it for everything. OS, browser, webpages, IDE, desktop background.

#14294 ESC crashes the game?
5 months ago Edited by Mevius on Feb. 18, 2018, 5:41 p.m. 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?

New to C family.
x13pixels
32 posts / 1 project

None

#14295 ESC crashes the game?
5 months ago

@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