From: Eric Anholt Date: Fri, 18 May 2007 19:59:39 +0000 (-0700) Subject: Allow unreference with a NULL argument. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=431baf221ea7858ecb5edb2a5a01b5f993147a4d;p=mesa.git Allow unreference with a NULL argument. --- diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.c b/src/mesa/drivers/dri/common/dri_bufmgr.c index f60d3b0db6b..dd76e8ead65 100644 --- a/src/mesa/drivers/dri/common/dri_bufmgr.c +++ b/src/mesa/drivers/dri/common/dri_bufmgr.c @@ -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); }