From bade906ed131e35ed1782f4687760dcdca233299 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 22 Sep 2009 10:59:26 -0700 Subject: st/xorg: Fix two leeks We where leaking both surfaces in the composit code and textures from pixmaps. --- src/gallium/state_trackers/xorg/xorg_composite.c | 3 +++ src/gallium/state_trackers/xorg/xorg_exa.c | 2 ++ 2 files changed, 5 insertions(+) (limited to 'src/gallium/state_trackers') diff --git a/src/gallium/state_trackers/xorg/xorg_composite.c b/src/gallium/state_trackers/xorg/xorg_composite.c index 66ca4cb5905..ed649a9d652 100644 --- a/src/gallium/state_trackers/xorg/xorg_composite.c +++ b/src/gallium/state_trackers/xorg/xorg_composite.c @@ -359,6 +359,9 @@ bind_framebuffer_state(struct exa_context *exa, struct exa_pixmap_priv *pDst) state.zsbuf = 0; cso_set_framebuffer(exa->cso, &state); + + /* we do fire and forget for the framebuffer, this is the forget part */ + pipe_surface_reference(&surface, NULL); } enum AxisOrientation { diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index dea9f4c2bc3..6507b2950e2 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -671,6 +671,8 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, #endif pipe_texture_reference(&priv->tex, texture); + /* the texture we create has one reference */ + pipe_texture_reference(&texture, NULL); } return TRUE; -- cgit v1.2.3