From a510bc3ee1a696da120c09ee4ec33dc033f671ac Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 6 Mar 2007 10:07:59 -0700 Subject: Fix/improve framebuffer object reference counting. Use _mesa_reference_framebuffer() and _mesa_unreference_framebuffer() functions to be sure reference counting is done correctly. Additional assertions are done too. Note _mesa_dereference_framebuffer() renamed to "unreference" as that's more accurate. --- src/mesa/drivers/dri/fb/fb_dri.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/mesa/drivers/dri/fb/fb_dri.c') diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index 08b52b4d8f7..a6d7590eff7 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -480,11 +480,7 @@ fbCreateBuffer( __DRIscreenPrivate *driScrnPriv, static void fbDestroyBuffer(__DRIdrawablePrivate *driDrawPriv) { - struct gl_framebuffer *mesa_framebuffer = (struct gl_framebuffer *)driDrawPriv->driverPrivate; - - _mesa_free(mesa_framebuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer->Data); - _mesa_destroy_framebuffer(mesa_framebuffer); - driDrawPriv->driverPrivate = NULL; + _mesa_unreference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate))); } -- cgit v1.2.3