diff options
author | Keith Whitwell <[email protected]> | 2005-01-12 19:38:41 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2005-01-12 19:38:41 +0000 |
commit | 0aca086f7a8d13efa548753c6c7836a98719dbde (patch) | |
tree | d809107d2c6a3bf433fc31b62ef18f90861b83dd /src | |
parent | 8e46534b3b776f1dd0f96fc6ba5244f16a2868ab (diff) |
free buffer in t_vertex_c.c on context delete
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/tnl/t_vertex.c | 2 | ||||
-rw-r--r-- | src/mesa/tnl/t_vertex.h | 1 | ||||
-rw-r--r-- | src/mesa/tnl/t_vertex_c.c | 8 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index 2ed4c417590..bc60665bbd1 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -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 ); } diff --git a/src/mesa/tnl/t_vertex.h b/src/mesa/tnl/t_vertex.h index caa222014c9..615bbdb4e45 100644 --- a/src/mesa/tnl/t_vertex.h +++ b/src/mesa/tnl/t_vertex.h @@ -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) diff --git a/src/mesa/tnl/t_vertex_c.c b/src/mesa/tnl/t_vertex_c.c index a901aed14c5..419e7b92420 100644 --- a/src/mesa/tnl/t_vertex_c.c +++ b/src/mesa/tnl/t_vertex_c.c @@ -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; + } +} |