diff --git a/src/twn_input.c b/src/twn_input.c index ce1bea3..2cbfa07 100644 --- a/src/twn_input.c +++ b/src/twn_input.c @@ -181,7 +181,7 @@ void input_state_init(InputState *input) { void input_state_deinit(InputState *input) { - shfree(input->action_hash); + input_reset_state(input); } diff --git a/src/twn_loop.c b/src/twn_loop.c index 928b19f..18a4dfc 100644 --- a/src/twn_loop.c +++ b/src/twn_loop.c @@ -534,10 +534,12 @@ static void clean_up(void) { scripting_deinit(ctx); */ - input_state_deinit(&ctx.game.input); + input_state_deinit(&ctx.game.input); text_cache_deinit(&ctx.text_cache); textures_cache_deinit(&ctx.texture_cache); + textures_reset_state(); + arrfree(ctx.render_queue_2d); toml_free(ctx.config_table); diff --git a/src/twn_textures.c b/src/twn_textures.c index 73e46cd..d151177 100644 --- a/src/twn_textures.c +++ b/src/twn_textures.c @@ -60,6 +60,7 @@ SDL_Surface *textures_load_surface(const char *path) { int width, height, channels; void *image_mem = stbi_load_from_callbacks(&callbacks, &context, &width, &height, &channels, 0); + SDL_FreeRW(handle); if (!image_mem) goto ERR_CANNOT_READ_IMAGE;