summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_imm_exec.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2001-05-09 13:53:36 +0000
committerKeith Whitwell <[email protected]>2001-05-09 13:53:36 +0000
commitbcf749e83a4844972b8fbb84e9762a9b1ec77c5f (patch)
tree095ccd846c8bc7b02f9363506f2e1f8e8f26ca8c /src/mesa/tnl/t_imm_exec.c
parent335634b807921285bec0709ee92c454cee87ee88 (diff)
fix possible segfault on destroy context
Diffstat (limited to 'src/mesa/tnl/t_imm_exec.c')
-rw-r--r--src/mesa/tnl/t_imm_exec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/tnl/t_imm_exec.c b/src/mesa/tnl/t_imm_exec.c
index 25de9a2af3c..adb79ab7d56 100644
--- a/src/mesa/tnl/t_imm_exec.c
+++ b/src/mesa/tnl/t_imm_exec.c
@@ -1,4 +1,4 @@
-/* $Id: t_imm_exec.c,v 1.21 2001/05/03 16:49:27 keithw Exp $ */
+/* $Id: t_imm_exec.c,v 1.22 2001/05/09 13:53:36 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -554,7 +554,8 @@ void _tnl_imm_destroy( GLcontext *ctx )
{
if (TNL_CURRENT_IM(ctx)) {
TNL_CURRENT_IM(ctx)->ref_count--;
- _tnl_free_immediate( TNL_CURRENT_IM(ctx) );
+ if (TNL_CURRENT_IM(ctx)->ref_count == 0)
+ _tnl_free_immediate( TNL_CURRENT_IM(ctx) );
SET_IMMEDIATE(ctx, 0);
}
}