From 431baf221ea7858ecb5edb2a5a01b5f993147a4d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 18 May 2007 12:59:39 -0700 Subject: [PATCH] Allow unreference with a NULL argument. --- src/mesa/drivers/dri/common/dri_bufmgr.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); } -- 2.30.2