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; }