st/glx: Fix leaks in xmesa_st_framebuffer.
authorChia-I Wu <olv@lunarg.com>
Fri, 12 Mar 2010 16:52:47 +0000 (00:52 +0800)
committerChia-I Wu <olv@lunarg.com>
Sat, 13 Mar 2010 05:06:00 +0000 (13:06 +0800)
The textures and surface of a framebuffer should be unreferenced when
the framebuffer is destroyed.

src/gallium/state_trackers/glx/xlib/xm_st.c

index 3b5f78e98ada6fa1e77e8785a5f4679cefbbd2bd..d462776363c616f555e98697ca80da8813c01e26 100644 (file)
@@ -225,6 +225,12 @@ void
 xmesa_destroy_st_framebuffer(struct st_framebuffer_iface *stfbi)
 {
    struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
+   int i;
+
+   pipe_surface_reference(&xstfb->display_surface, NULL);
+
+   for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
+      pipe_texture_reference(&xstfb->textures[i], NULL);
 
    FREE(xstfb);
    FREE(stfbi);