llvmpipe: fix texture/display target memory leak
authorBrian Paul <brianp@vmware.com>
Thu, 29 Apr 2010 15:10:05 +0000 (09:10 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 29 Apr 2010 15:10:05 +0000 (09:10 -0600)
src/gallium/drivers/llvmpipe/lp_texture.c

index 3468fbfb1f304b041d212fc5c3502ab4354ad912..2f41d620c8a675f97a010efa5e4e38a2776e66da 100644 (file)
@@ -242,6 +242,11 @@ llvmpipe_resource_destroy(struct pipe_screen *pscreen,
       struct sw_winsys *winsys = screen->winsys;
       winsys->displaytarget_destroy(winsys, lpr->dt);
 
+      if (lpr->tiled[0].data) {
+         align_free(lpr->tiled[0].data);
+         lpr->tiled[0].data = NULL;
+      }
+
       FREE(lpr->layout[0]);
    }
    else if (resource_is_texture(pt)) {