llvmpipe: free vertex buffer memory in lp_setup_vbuf_destroy()
authorBrian Paul <brianp@vmware.com>
Wed, 28 Apr 2010 21:23:03 +0000 (15:23 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 28 Apr 2010 21:25:50 +0000 (15:25 -0600)
src/gallium/drivers/llvmpipe/lp_setup_vbuf.c

index a401275478464828a7ca58cb6a7480767c2fcef3..5d3122e8ba23ef4a6995f429f13ff6fc6ce44c0f 100644 (file)
@@ -440,7 +440,12 @@ lp_setup_draw_arrays(struct vbuf_render *vbr, uint start, uint nr)
 static void
 lp_setup_vbuf_destroy(struct vbuf_render *vbr)
 {
-   lp_setup_destroy(lp_setup_context(vbr));
+   struct lp_setup_context *setup = lp_setup_context(vbr);
+   if (setup->vertex_buffer) {
+      align_free(setup->vertex_buffer);
+      setup->vertex_buffer = NULL;
+   }
+   lp_setup_destroy(setup);
 }