Mesa (master): mesa: simplify delete_wrapper()

Brian Paul brianp at kemper.freedesktop.org
Tue Feb 3 22:37:53 UTC 2009


Module: Mesa
Branch: master
Commit: b5d549e3514af1d299b27d80bd157a65f397fe15
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b5d549e3514af1d299b27d80bd157a65f397fe15

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Feb  3 09:21:32 2009 -0700

mesa: simplify delete_wrapper()

---

 src/mesa/main/depthstencil.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/src/mesa/main/depthstencil.c b/src/mesa/main/depthstencil.c
index 9d208e2..7be2aac 100644
--- a/src/mesa/main/depthstencil.c
+++ b/src/mesa/main/depthstencil.c
@@ -62,15 +62,9 @@ nop_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y)
 static void
 delete_wrapper(struct gl_renderbuffer *rb)
 {
-   struct gl_renderbuffer *dsrb = rb->Wrapped;
-   ASSERT(dsrb);
    ASSERT(rb->_ActualFormat == GL_DEPTH_COMPONENT24 ||
           rb->_ActualFormat == GL_STENCIL_INDEX8_EXT);
-   /* decrement refcount on the wrapped buffer and delete it if necessary */
-   dsrb->RefCount--;
-   if (dsrb->RefCount <= 0) {
-      dsrb->Delete(dsrb);
-   }
+   _mesa_reference_renderbuffer(&rb->Wrapped, NULL);
    _mesa_free(rb);
 }
 




More information about the mesa-commit mailing list