From dbe1eae785e8a98eb3d515b572c8e5e28b234edd Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Fri, 29 Oct 2010 21:14:49 +0200 Subject: dri/nouveau: Avoid recursion in nouveau_bo_context_reset(). --- src/mesa/drivers/dri/nouveau/nouveau_bo_state.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa/drivers/dri') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c b/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c index f31772fe1d1..7eef8c1ee81 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_bo_state.c @@ -126,13 +126,13 @@ void nouveau_bo_context_reset(struct nouveau_bo_context *bctx) { struct nouveau_bo_state *s = &to_nouveau_context(bctx->ctx)->bo; - int i; - - for (i = 0; i < bctx->count; i++) - nouveau_bo_ref(NULL, &bctx->marker[i].bo); + int i, n = bctx->count; - s->count -= bctx->count; + s->count -= n; bctx->count = 0; + + for (i = 0; i < n; i++) + nouveau_bo_ref(NULL, &bctx->marker[i].bo); } GLboolean -- cgit v1.2.3