free buffer in t_vertex_c.c on context delete
authorKeith Whitwell <keith@tungstengraphics.com>
Wed, 12 Jan 2005 19:38:41 +0000 (19:38 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Wed, 12 Jan 2005 19:38:41 +0000 (19:38 +0000)
src/mesa/tnl/t_vertex.c
src/mesa/tnl/t_vertex.h
src/mesa/tnl/t_vertex_c.c

index 2ed4c417590314babea5643d077c89a4f33cd33d..bc60665bbd1c1c8e0ba705065603e8e36b14c3a5 100644 (file)
@@ -1442,4 +1442,6 @@ void _tnl_free_vertices( GLcontext *ctx )
       ALIGN_FREE(vtx->vertex_buf);
       vtx->vertex_buf = 0;
    }
+   
+   _tnl_free_c_codegen( &vtx->codegen );
 }
index caa222014c9b6e0594ba4e3734960bbdc277cefc..615bbdb4e455e184483622b6f9e105423b94a3b2 100644 (file)
@@ -144,6 +144,7 @@ extern tnl_emit_func _tnl_codegen_emit( GLcontext *ctx );
 
 
 extern void _tnl_init_c_codegen( struct tnl_clipspace_codegen *p );
+extern void _tnl_free_c_codegen( struct tnl_clipspace_codegen *p );
 
 #define GET_VERTEX_STATE(ctx)  &(TNL_CONTEXT(ctx)->clipspace)
 
index a901aed14c5c081d07234953293e2984f7f93b79..419e7b9242039c84826c300432e02d780f51c83b 100644 (file)
@@ -257,3 +257,11 @@ void _tnl_init_c_codegen( struct tnl_clipspace_codegen *p )
    p->buf_size = 2048;
    p->buf = (char *) MALLOC(p->buf_size);
 }
+
+void _tnl_free_c_codegen( struct tnl_clipspace_codegen *p )
+{
+   if (p->buf) {
+      FREE(p->buf);
+      p->buf = 0;
+   }
+}