intel: added null ptr check
authorBrian Paul <brianp@vmware.com>
Wed, 13 May 2009 17:31:35 +0000 (11:31 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 13 May 2009 17:33:16 +0000 (11:33 -0600)
Fixes segfault in context tear-down when glClear was never called.

src/mesa/drivers/dri/intel/intel_context.c

index 07d53aad23f59ad20ca356e8a61b92da7f760195..5dc3df395d18f4a887b29dca32dce0b2789e1580 100644 (file)
@@ -756,7 +756,8 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
 
       INTEL_FIREVERTICES(intel);
 
-      _mesa_delete_array_object(&intel->ctx, intel->clear.arrayObj);
+      if (intel->clear.arrayObj)
+         _mesa_delete_array_object(&intel->ctx, intel->clear.arrayObj);
 
       intel->vtbl.destroy(intel);