From 9f7d6b72108d9d8bec5f567bcaf33714ffe3ebc2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 13 Dec 2007 01:01:31 -0800 Subject: [PATCH] [intel] assert that buffers are not mapped at last unreference. bufmgr_fake doesn't care about it, but with ttm we would end up with the buffer remaining referenced until application exit. --- src/mesa/drivers/dri/common/dri_bufmgr_fake.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c index 5cd96f0821d..f022552ed85 100644 --- a/src/mesa/drivers/dri/common/dri_bufmgr_fake.c +++ b/src/mesa/drivers/dri/common/dri_bufmgr_fake.c @@ -665,6 +665,7 @@ dri_fake_bo_unreference(dri_bo *bo) _glthread_LOCK_MUTEX(bufmgr_fake->mutex); if (--bo_fake->refcount == 0) { + assert(bo_fake->map_count == 0); /* No remaining references, so free it */ if (bo_fake->block) free_block(bufmgr_fake, bo_fake->block); -- 2.30.2