src/renwindow: correctly free texture and renderer

This commit is contained in:
takase1121 2024-07-04 21:31:54 +08:00 committed by Takase
parent 96579d9a7f
commit 3d0344393c
1 changed files with 2 additions and 2 deletions

View File

@ -132,11 +132,11 @@ void renwin_update_rects(RenWindow *ren, RenRect *rects, int count) {
} }
void renwin_free(RenWindow *ren) { void renwin_free(RenWindow *ren) {
SDL_DestroyWindow(ren->window);
ren->window = NULL;
#ifdef LITE_USE_SDL_RENDERER #ifdef LITE_USE_SDL_RENDERER
SDL_DestroyTexture(ren->texture); SDL_DestroyTexture(ren->texture);
SDL_DestroyRenderer(ren->renderer); SDL_DestroyRenderer(ren->renderer);
SDL_FreeSurface(ren->rensurface.surface); SDL_FreeSurface(ren->rensurface.surface);
#endif #endif
SDL_DestroyWindow(ren->window);
ren->window = NULL;
} }