You can't free locked surfaces!

This commit is contained in:
Sam Lantinga
2004-07-25 18:43:07 +00:00
parent 32a76c379b
commit 15fba045d8

View File

@@ -901,6 +901,9 @@ void SDL_FreeSurface (SDL_Surface *surface)
if ( --surface->refcount > 0 ) {
return;
}
while ( surface->locked > 0 ) {
SDL_UnlockSurface(surface);
}
if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
SDL_UnRLESurface(surface, 0);
}