Commit ee929726 authored by Sam Lantinga's avatar Sam Lantinga

You can't free locked surfaces!

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40916
parent a69bbd47
...@@ -901,6 +901,9 @@ void SDL_FreeSurface (SDL_Surface *surface) ...@@ -901,6 +901,9 @@ void SDL_FreeSurface (SDL_Surface *surface)
if ( --surface->refcount > 0 ) { if ( --surface->refcount > 0 ) {
return; return;
} }
while ( surface->locked > 0 ) {
SDL_UnlockSurface(surface);
}
if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) { if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
SDL_UnRLESurface(surface, 0); SDL_UnRLESurface(surface, 0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment