From: Brian Paul Date: Wed, 8 Jun 2005 02:14:55 +0000 (+0000) Subject: check for double-buffered buffer in XMesaDestroyBuffer() (Dave Reveman) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0b5c983645e672b6c86d2bd52764ad58fda5d70;p=mesa.git check for double-buffered buffer in XMesaDestroyBuffer() (Dave Reveman) --- diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index d902db0e3e5..f710a298664 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1999,24 +1999,27 @@ void XMesaDestroyBuffer( XMesaBuffer b ) if (b->cleargc) XMesaFreeGC( b->xm_visual->display, b->cleargc ); if (b->swapgc) XMesaFreeGC( b->xm_visual->display, b->swapgc ); - if (b->backxrb->ximage) { + if (b->xm_visual->mesa_visual.doubleBufferMode) + { + if (b->backxrb->ximage) { #if defined(USE_XSHM) && !defined(XFree86Server) - if (b->shm) { - XShmDetach( b->xm_visual->display, &b->shminfo ); - XDestroyImage( b->backxrb->ximage ); - shmdt( b->shminfo.shmaddr ); - } - else + if (b->shm) { + XShmDetach( b->xm_visual->display, &b->shminfo ); + XDestroyImage( b->backxrb->ximage ); + shmdt( b->shminfo.shmaddr ); + } + else #endif - XMesaDestroyImage( b->backxrb->ximage ); - } - if (b->backxrb->pixmap) { - XMesaFreePixmap( b->xm_visual->display, b->backxrb->pixmap ); - if (b->xm_visual->hpcr_clear_flag) { - XMesaFreePixmap( b->xm_visual->display, - b->xm_visual->hpcr_clear_pixmap ); - XMesaDestroyImage( b->xm_visual->hpcr_clear_ximage ); - } + XMesaDestroyImage( b->backxrb->ximage ); + } + if (b->backxrb->pixmap) { + XMesaFreePixmap( b->xm_visual->display, b->backxrb->pixmap ); + if (b->xm_visual->hpcr_clear_flag) { + XMesaFreePixmap( b->xm_visual->display, + b->xm_visual->hpcr_clear_pixmap ); + XMesaDestroyImage( b->xm_visual->hpcr_clear_ximage ); + } + } } if (b->rowimage) { _mesa_free( b->rowimage->data ); @@ -2634,7 +2637,7 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y, */ void XMesaResizeBuffers( XMesaBuffer b ) { -#if OLD_RENDERBUFFER && 0 +#if OLD_RENDERBUFFER xmesa_resize_buffers(ctx, &(b->mesa_buffer), 0, 0 ); #endif }