intel: NULL fake bo block when freeing in evict_all
authorJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 22 Apr 2009 00:13:16 +0000 (17:13 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 27 Apr 2009 18:49:16 +0000 (11:49 -0700)
Fixes assertion failures on later use of the object.

libdrm/intel/intel_bufmgr_fake.c

index e1f98d6..969c03d 100644 (file)
@@ -1467,8 +1467,10 @@ drm_intel_bufmgr_fake_evict_all(drm_intel_bufmgr *bufmgr)
    assert(DRMLISTEMPTY(&bufmgr_fake->on_hardware));
 
    DRMLISTFOREACHSAFE(block, tmp, &bufmgr_fake->lru) {
+      drm_intel_bo_fake *bo_fake = (drm_intel_bo_fake *)block->bo;
       /* Releases the memory, and memcpys dirty contents out if necessary. */
       free_block(bufmgr_fake, block, 0);
+      bo_fake->block = NULL;
    }
 
    pthread_mutex_unlock(&bufmgr_fake->lock);