Fix SDLTexture backend's linked-list

Was causing some use-after-free behaviour, according to valgrind.

Should fix #87
This commit is contained in:
Clownacy 2020-01-06 14:48:08 +00:00
parent 1cc3d7fe30
commit df534bb612

View file

@ -116,6 +116,9 @@ Backend_Surface* Backend_CreateSurface(unsigned int width, unsigned int height)
surface->next = surface_list_head; surface->next = surface_list_head;
surface_list_head = surface; surface_list_head = surface;
if (surface->next != NULL)
surface->next->prev = surface;
return surface; return surface;
} }