mesa: simplify delete_wrapper()
authorBrian Paul <brianp@vmware.com>
Tue, 3 Feb 2009 16:21:32 +0000 (09:21 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 3 Feb 2009 22:36:38 +0000 (15:36 -0700)
src/mesa/main/depthstencil.c

index 9d208e2997d39ed4ec19ed442c0771880b6ae2c4..7be2aacaf2c0efbf1aaf0f61d2d67e390eb11177 100644 (file)
@@ -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);
 }