summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-07-19 15:54:34 +0000
committerBrian Paul <[email protected]>2001-07-19 15:54:34 +0000
commitfd28445e102800b84e49e3f2299ef7dd8af8b89d (patch)
treea382415605961999aea97f62ea17c6cb3f33743a /src/mesa
parent2a9eca0ed4d07329141bf8226b60eef83101a216 (diff)
Added Win32 memory debugging and fixed a few memory leaks (Gerk Huisma)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/array_cache/ac_context.c6
-rw-r--r--src/mesa/main/context.c12
-rw-r--r--src/mesa/tnl/t_context.c3
3 files changed, 18 insertions, 3 deletions
diff --git a/src/mesa/array_cache/ac_context.c b/src/mesa/array_cache/ac_context.c
index e9c4fe869ad..569b62b6540 100644
--- a/src/mesa/array_cache/ac_context.c
+++ b/src/mesa/array_cache/ac_context.c
@@ -1,4 +1,4 @@
-/* $Id: ac_context.c,v 1.4 2001/04/28 08:39:18 keithw Exp $ */
+/* $Id: ac_context.c,v 1.5 2001/07/19 15:54:35 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -263,6 +263,10 @@ void _ac_DestroyContext( GLcontext *ctx )
}
if (ac->Elts) FREE( ac->Elts );
+
+ /* Free the context structure itself */
+ FREE(ac);
+ ctx->acache_context = NULL;
}
void _ac_InvalidateState( GLcontext *ctx, GLuint new_state )
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 444789a817e..4f2718140de 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.144 2001/06/26 01:32:48 brianp Exp $ */
+/* $Id: context.c,v 1.145 2001/07/19 15:54:34 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1607,6 +1607,13 @@ _mesa_free_context_data( GLcontext *ctx )
}
}
+ _math_matrix_dtr( &ctx->_ModelProjectMatrix );
+
+ _math_matrix_dtr(&ctx->ColorMatrix);
+ for (j = 0; j < MAX_COLOR_STACK_DEPTH - 1; j++) {
+ _math_matrix_dtr(&ctx->ColorStack[j]);
+ }
+
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
ctx->Shared->RefCount--;
assert(ctx->Shared->RefCount >= 0);
@@ -1625,6 +1632,7 @@ _mesa_free_context_data( GLcontext *ctx )
_mesa_free_texture_object( NULL, ctx->Texture.Proxy1D );
_mesa_free_texture_object( NULL, ctx->Texture.Proxy2D );
_mesa_free_texture_object( NULL, ctx->Texture.Proxy3D );
+ _mesa_free_texture_object( NULL, ctx->Texture.ProxyCubeMap );
/* Free evaluator data */
if (ctx->EvalMap.Map1Vertex3.Points)
@@ -1670,6 +1678,8 @@ _mesa_free_context_data( GLcontext *ctx )
_mesa_free_colortable_data( &ctx->PostColorMatrixColorTable );
_mesa_free_colortable_data( &ctx->Texture.Palette );
+ _math_matrix_dtr(&ctx->Viewport._WindowMap);
+
_mesa_extensions_dtr(ctx);
FREE(ctx->Exec);
diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c
index 76f4180b657..130a3febe50 100644
--- a/src/mesa/tnl/t_context.c
+++ b/src/mesa/tnl/t_context.c
@@ -1,4 +1,4 @@
-/* $Id: t_context.c,v 1.21 2001/07/12 22:09:21 keithw Exp $ */
+/* $Id: t_context.c,v 1.22 2001/07/19 15:54:35 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -139,6 +139,7 @@ _tnl_DestroyContext( GLcontext *ctx )
_tnl_array_destroy( ctx );
_tnl_imm_destroy( ctx );
_tnl_destroy_pipeline( ctx );
+ _tnl_free_immediate( tnl->freed_immediate );
FREE(tnl);
ctx->swtnl_context = 0;