OSDN Git Service

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 3468fbf..2f41d62 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)) {