summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2005-08-10 14:13:45 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2005-08-10 14:13:45 +0000
commit738c9a073f6108df0f13c47daa3f24878d2d26ec (patch)
tree525d40786b3f22935ea4255765b555604b3ccb5f /src
parent258f005c6b83d537cd08f10aa6d01251605aa941 (diff)
Check for prim/vertex store non-null before messing with refcounts.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/tnl/t_save_api.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c
index b43b048083..9788468d50 100644
--- a/src/mesa/tnl/t_save_api.c
+++ b/src/mesa/tnl/t_save_api.c
@@ -1714,9 +1714,11 @@ void _tnl_save_destroy( GLcontext *ctx )
* display lists yet to be destroyed, so it may not yet be time to
* free these items.
*/
- if ( --tnl->save.prim_store->refcount == 0 )
+ if (tnl->save.prim_store &&
+ --tnl->save.prim_store->refcount == 0 )
FREE( tnl->save.prim_store );
- if ( --tnl->save.vertex_store->refcount == 0 )
+ if (tnl->save.vertex_store &&
+ --tnl->save.vertex_store->refcount == 0 )
FREE( tnl->save.vertex_store );
}