Allow unreference with a NULL argument.
authorEric Anholt <eric@anholt.net>
Fri, 18 May 2007 19:59:39 +0000 (12:59 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 18 May 2007 19:59:39 +0000 (12:59 -0700)
src/mesa/drivers/dri/common/dri_bufmgr.c

index f60d3b0db6bd8f7a6953b84f79cfb7bcd3da6d71..dd76e8ead6556a4e5dd4389e6bfcfaf0c3d5d4cb 100644 (file)
@@ -58,6 +58,9 @@ dri_bo_reference(dri_bo *bo)
 void
 dri_bo_unreference(dri_bo *bo)
 {
+   if (bo == NULL)
+      return;
+
    bo->bufmgr->bo_unreference(bo);
 }
 
@@ -100,6 +103,9 @@ dri_fence_reference(dri_fence *fence)
 void
 dri_fence_unreference(dri_fence *fence)
 {
+   if (fence == NULL)
+      return;
+
    fence->bufmgr->fence_unreference(fence);
 }