From a120778c72324bc56c63cd0f1873c6f2772228ea Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Fri, 19 Jun 2009 11:19:08 +0200 Subject: Always free image offsets memory when re-initializing texture image fields. Fixes leak running compiz with direct rendering. --- src/mesa/main/teximage.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa/main/teximage.c') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 76b46d700b..6e21066537 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1250,6 +1250,8 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target, * We allocate the array for 1D/2D textures too in order to avoid special- * case code in the texstore routines. */ + if (img->ImageOffsets) + _mesa_free(img->ImageOffsets); img->ImageOffsets = (GLuint *) _mesa_malloc(depth * sizeof(GLuint)); for (i = 0; i < depth; i++) { img->ImageOffsets[i] = i * width * height; -- cgit v1.2.3