From ca0305feabf67bbaf504bf322f408c0fa06e5343 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Tue, 27 Aug 2024 14:48:08 +0300 Subject: [PATCH] free texture data from stb_image --- townengine/textures/textures.c | 1 + 1 file changed, 1 insertion(+) diff --git a/townengine/textures/textures.c b/townengine/textures/textures.c index 6f896d5..f950227 100644 --- a/townengine/textures/textures.c +++ b/townengine/textures/textures.c @@ -297,6 +297,7 @@ void textures_cache_deinit(struct texture_cache *cache) { /* free cache hashes */ for (size_t i = 0; i < shlenu(cache->hash); ++i) { + stbi_image_free(cache->hash[i].value.data->pixels); SDL_FreeSurface(cache->hash[i].value.data); } shfree(cache->hash);