diff options
author | Francisco Jerez <currojerez@riseup.net> | 2010-10-29 21:14:49 +0200 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2010-10-31 02:45:31 +0200 |
commit | dbe1eae785e8a98eb3d515b572c8e5e28b234edd (patch) | |
tree | 9980057ae44582a360e4160add3b825e634b5e14 | |
parent | f2098e0fefbbcd72df4c8283d195beae4a113f35 (diff) |
dri/nouveau: Avoid recursion in nouveau_bo_context_reset().
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_bo_state.c | 10 |
1 files changed, 5 insertions, 5 deletions
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 |