/* add front renderbuffer */
frontrb = swrast_new_renderbuffer(visual, dPriv, GL_TRUE);
- _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontrb->Base.Base);
+ _mesa_add_renderbuffer_without_ref(fb, BUFFER_FRONT_LEFT,
+ &frontrb->Base.Base);
/* add back renderbuffer */
if (visual->doubleBufferMode) {
backrb = swrast_new_renderbuffer(visual, dPriv, GL_FALSE);
- _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backrb->Base.Base);
+ _mesa_add_renderbuffer_without_ref(fb, BUFFER_BACK_LEFT,
+ &backrb->Base.Base);
}
/* add software renderbuffers */
return GL_FALSE;
}
- /* Set refcount to 0 to avoid a leak since the _mesa_add_renderbuffer()
- * call below will bump the initial refcount.
- */
- rb->RefCount = 0;
-
rb->InternalFormat = GL_RGBA;
rb->AllocStorage = soft_renderbuffer_storage;
- _mesa_add_renderbuffer(fb, b, rb);
+ _mesa_add_renderbuffer_without_ref(fb, b, rb);
}
return GL_TRUE;
}
rb->AllocStorage = soft_renderbuffer_storage;
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, rb);
+ _mesa_add_renderbuffer_without_ref(fb, BUFFER_DEPTH, rb);
return GL_TRUE;
}
rb->InternalFormat = GL_STENCIL_INDEX8;
rb->AllocStorage = soft_renderbuffer_storage;
- _mesa_add_renderbuffer(fb, BUFFER_STENCIL, rb);
+ _mesa_add_renderbuffer_without_ref(fb, BUFFER_STENCIL, rb);
return GL_TRUE;
}
rb->InternalFormat = GL_DEPTH_STENCIL;
rb->AllocStorage = soft_renderbuffer_storage;
- _mesa_add_renderbuffer(fb, BUFFER_DEPTH, rb);
+ _mesa_add_renderbuffer_without_ref(fb, BUFFER_DEPTH, rb);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, rb);
return GL_TRUE;
rb->InternalFormat = GL_RGBA16_SNORM;
rb->AllocStorage = soft_renderbuffer_storage;
- _mesa_add_renderbuffer(fb, BUFFER_ACCUM, rb);
+ _mesa_add_renderbuffer_without_ref(fb, BUFFER_ACCUM, rb);
return GL_TRUE;
}
rb->InternalFormat = GL_RGBA;
rb->AllocStorage = soft_renderbuffer_storage;
- _mesa_add_renderbuffer(fb, BUFFER_AUX0 + i, rb);
+ _mesa_add_renderbuffer_without_ref(fb, BUFFER_AUX0 + i, rb);
}
return GL_TRUE;
}