aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2010-10-29 21:14:49 +0200
committerFrancisco Jerez <[email protected]>2010-10-31 02:45:31 +0200
commitdbe1eae785e8a98eb3d515b572c8e5e28b234edd (patch)
tree9980057ae44582a360e4160add3b825e634b5e14 /src/mesa
parentf2098e0fefbbcd72df4c8283d195beae4a113f35 (diff)
dri/nouveau: Avoid recursion in nouveau_bo_context_reset().
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_bo_state.c10
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