From 3d0344393c12b1efe947969a9fcca9eb08603536 Mon Sep 17 00:00:00 2001 From: takase1121 <20792268+takase1121@users.noreply.github.com> Date: Thu, 4 Jul 2024 21:31:54 +0800 Subject: [PATCH] src/renwindow: correctly free texture and renderer --- src/renwindow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renwindow.c b/src/renwindow.c index abc2c910..98330903 100644 --- a/src/renwindow.c +++ b/src/renwindow.c @@ -132,11 +132,11 @@ void renwin_update_rects(RenWindow *ren, RenRect *rects, int count) { } void renwin_free(RenWindow *ren) { - SDL_DestroyWindow(ren->window); - ren->window = NULL; #ifdef LITE_USE_SDL_RENDERER SDL_DestroyTexture(ren->texture); SDL_DestroyRenderer(ren->renderer); SDL_FreeSurface(ren->rensurface.surface); #endif + SDL_DestroyWindow(ren->window); + ren->window = NULL; }