From 4611b9398e6164ea419bf587e759a354be4c58b4 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 5 Oct 2007 14:33:18 +1000 Subject: [PATCH] i915: clean up lists on teardown also fix a use of uninitialised pointer --- src/mesa/drivers/dri/i915/intel_bufmgr_ttm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i915/intel_bufmgr_ttm.c b/src/mesa/drivers/dri/i915/intel_bufmgr_ttm.c index 466dc1ec323..990c58aa256 100644 --- a/src/mesa/drivers/dri/i915/intel_bufmgr_ttm.c +++ b/src/mesa/drivers/dri/i915/intel_bufmgr_ttm.c @@ -160,7 +160,6 @@ static int intel_adjust_list_nodes(struct intel_bo_list *list) return ret; } -#if 0 void intel_bo_free_list(struct intel_bo_list *list) { struct intel_bo_node *node; @@ -185,7 +184,6 @@ void intel_bo_free_list(struct intel_bo_list *list) list->numCurrent--; } } -#endif static int intel_bo_reset_list(struct intel_bo_list *list) { @@ -218,7 +216,7 @@ static int intel_create_bo_list(int numTarget, struct intel_bo_list *list, void list->numTarget = numTarget; list->numCurrent = 0; list->numOnList = 0; - if (list->destroy) + if (destroy) list->destroy = destroy; else list->destroy = generic_destroy; @@ -840,6 +838,9 @@ dri_bufmgr_ttm_destroy(dri_bufmgr *bufmgr) { dri_bufmgr_ttm *bufmgr_ttm = (dri_bufmgr_ttm *)bufmgr; + intel_bo_free_list(&bufmgr_ttm->list); + intel_bo_free_list(&bufmgr_ttm->reloc_list); + _glthread_DESTROY_MUTEX(bufmgr_ttm->mutex); free(bufmgr); } -- 2.30.2