SDL_Surface refcount: destination surface keep track of surfaces

that are mapped to it and automatically invalidate them when it is freed

- refcount is kept so that an external application can still create a reference
to SDL_Surface.

- lock_data was un-used and is now renamed and used as a list keep track of the blitmap
This commit is contained in:
Sylvain Becker
2020-09-07 18:50:30 +02:00
parent cce6c60518
commit ebc12a2fd2
4 changed files with 67 additions and 13 deletions

View File

@@ -1328,6 +1328,8 @@ SDL_FreeSurface(SDL_Surface * surface)
}
SDL_InvalidateMap(surface->map);
SDL_InvalidateAllBlitMap(surface);
if (--surface->refcount > 0) {
return;
}