Fix SDLTexture surface freeing

This commit is contained in:
Clownacy 2020-09-13 12:30:56 +01:00
parent bf93334b94
commit aa3cd55b43

View file

@ -182,6 +182,9 @@ void RenderBackend_FreeSurface(RenderBackend_Surface *surface)
if (surface->prev != NULL) if (surface->prev != NULL)
surface->prev->next = surface->next; surface->prev->next = surface->next;
if (surface->prev == NULL)
surface_list_head = surface->next;
SDL_DestroyTexture(surface->texture); SDL_DestroyTexture(surface->texture);
free(surface); free(surface);
} }