# HG changeset patch # User Sam Lantinga # Date 1147157087 0 # Node ID 473abd216edb164b099c65be7e70e2595a81d1fa # Parent dcec47a019e2a813ba9c3ecbe5781ed02b7ce157 Fixed bug #106 Wait for any pending operations to complete before freeing a hardware surface. diff -r dcec47a019e2 -r 473abd216edb src/video/dga/SDL_dgavideo.c --- a/src/video/dga/SDL_dgavideo.c Tue May 09 06:14:11 2006 +0000 +++ b/src/video/dga/SDL_dgavideo.c Tue May 09 06:44:47 2006 +0000 @@ -771,6 +771,13 @@ { vidmem_bucket *bucket, *freeable; + /* Wait for any pending operations involving this surface */ + if ( DGA_IsSurfaceBusy(surface) ) { + LOCK_DISPLAY(); + DGA_WaitBusySurfaces(this); + UNLOCK_DISPLAY(); + } + /* Look for the bucket in the current list */ for ( bucket=&surfaces; bucket; bucket=bucket->next ) { if ( bucket == (vidmem_bucket *)surface->hwdata ) { @@ -1054,7 +1061,7 @@ SDL_NAME(XDGACloseFramebuffer)(DGA_Display, DGA_Screen); if ( this->screen ) { /* Tell SDL not to free the pixels */ - this->screen->pixels = NULL; + DGA_FreeHWSurface(this, this->screen); } SDL_NAME(XDGASetMode)(DGA_Display, DGA_Screen, 0);