Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed bug #106
Wait for any pending operations to complete before freeing a hardware surface.
  • Loading branch information
slouken committed May 9, 2006
1 parent 73d0dd6 commit 1c443ed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/video/dga/SDL_dgavideo.c
Expand Up @@ -771,6 +771,13 @@ static void DGA_FreeHWSurface(_THIS, SDL_Surface *surface)
{
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 ) {
Expand Down Expand Up @@ -1054,7 +1061,7 @@ void DGA_VideoQuit(_THIS)
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);

Expand Down

0 comments on commit 1c443ed

Please sign in to comment.