diff --git a/src/Backends/Rendering/SDLTexture.cpp b/src/Backends/Rendering/SDLTexture.cpp index 6a538462..fbe8aaac 100644 --- a/src/Backends/Rendering/SDLTexture.cpp +++ b/src/Backends/Rendering/SDLTexture.cpp @@ -182,6 +182,9 @@ void RenderBackend_FreeSurface(RenderBackend_Surface *surface) if (surface->prev != NULL) surface->prev->next = surface->next; + if (surface->prev == NULL) + surface_list_head = surface->next; + SDL_DestroyTexture(surface->texture); free(surface); }