summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_renderbuffer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_renderbuffer.c b/src/mesa/swrast/s_renderbuffer.c
index d8c4ed38638..af09955484e 100644
--- a/src/mesa/swrast/s_renderbuffer.c
+++ b/src/mesa/swrast/s_renderbuffer.c
@@ -271,6 +271,11 @@ add_color_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
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;