From ee929726379646f45b2376e86c7ef8dfc882811a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 25 Jul 2004 18:43:07 +0000 Subject: [PATCH] You can't free locked surfaces! --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40916 --- src/video/SDL_surface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 65fb0bc01..934a9195b 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -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); }