diff options
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r-- | src/mesa/main/context.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 9b12ad0ede..d7f751dba5 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1,4 +1,4 @@ -/* $Id: context.c,v 1.8 1999/09/18 20:41:22 keithw Exp $ */ +/* $Id: context.c,v 1.9 1999/09/19 23:43:02 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -1350,10 +1350,17 @@ void gl_destroy_context( GLcontext *ctx ) for (i = 0 ; i < MAX_MODELVIEW_STACK_DEPTH ; i++) { gl_matrix_dtr( &ctx->ModelViewStack[i] ); } - + gl_matrix_dtr( &ctx->ProjectionMatrix ); + for (i = 0 ; i < MAX_PROJECTION_STACK_DEPTH ; i++) { + gl_matrix_dtr( &ctx->ProjectionStack[i] ); + } free( ctx->PB ); - free( ctx->VB ); + + if(ctx->input != ctx->VB->IM) + gl_immediate_free( ctx->input ); + + gl_vb_free( ctx->VB ); ctx->Shared->RefCount--; assert(ctx->Shared->RefCount>=0); @@ -1411,6 +1418,14 @@ void gl_destroy_context( GLcontext *ctx ) if (ctx->EvalMap.Map2Texture4.Points) free( ctx->EvalMap.Map2Texture4.Points ); + /* Free cache of immediate buffers. */ + while (ctx->nr_im_queued-- > 0) { + struct immediate * next = ctx->freed_im_queue->next; + free( ctx->freed_im_queue ); + ctx->freed_im_queue = next; + } + gl_extensions_dtr(ctx); + free( (void *) ctx ); #ifndef THREADS |