summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/x11/xm_buffer.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-03-06 16:25:07 -0700
committerBrian <[email protected]>2007-03-06 16:25:07 -0700
commit955906aa647d0d233b422c979e1ee81dc32abb87 (patch)
tree94de64592607bc96b35e455d02ae9fdea4484f80 /src/mesa/drivers/x11/xm_buffer.c
parent37fd6be41134df46cb9dad7f9201188ff9707629 (diff)
fix renderbuffer mem leak
Diffstat (limited to 'src/mesa/drivers/x11/xm_buffer.c')
-rw-r--r--src/mesa/drivers/x11/xm_buffer.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c
index a358ec25aec..747971a6c30 100644
--- a/src/mesa/drivers/x11/xm_buffer.c
+++ b/src/mesa/drivers/x11/xm_buffer.c
@@ -418,6 +418,18 @@ xmesa_delete_framebuffer(struct gl_framebuffer *fb)
XMesaDestroyImage( b->rowimage );
}
+ /* Note that XMesaBuffer renderbuffers normally have a refcount of 2
+ * (creation + binding) so we need to explicitly delete/unbind them here.
+ */
+ if (b->frontxrb) {
+ _mesa_unreference_renderbuffer((struct gl_renderbuffer **) &b->frontxrb);
+ ASSERT(b->frontxrb == NULL);
+ }
+ if (b->backxrb) {
+ _mesa_unreference_renderbuffer((struct gl_renderbuffer **) &b->backxrb);
+ ASSERT(b->backxrb == NULL);
+ }
+
_mesa_free_framebuffer_data(fb);
_mesa_free(fb);
}