summaryrefslogtreecommitdiff
path: root/src/state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/state.c b/src/state.c
index d1a3329..b2b8aa0 100644
--- a/src/state.c
+++ b/src/state.c
@@ -211,11 +211,12 @@ void stateFree() {
if ( IsAudioDeviceReady() ) {
CloseAudioDevice();
}
- if ( state->hasWindow ) {
- CloseWindow();
- }
if ( state->luaState != NULL ) {
lua_close( state->luaState );
+ state->luaState = NULL;
+ }
+ if ( state->hasWindow ) {
+ CloseWindow();
}
free( state->images );
free( state->textures );