diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-03 15:25:01 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-03 15:25:01 +0000 |
commit | 2583232773f1fa505e0676f07b029b29b90c8ea7 (patch) | |
tree | 1a5e6aefbac35e61a2d65d8ce041baf66751ade5 /src/sna/sna_gradient.c | |
parent | 4dec895b69c2e545b142a3646646e13f7fb06507 (diff) |
sna: Nullify cache pointers upon server regen
To make sure we don't chase dangling pointers on the next pass.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_gradient.c')
-rw-r--r-- | src/sna/sna_gradient.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sna/sna_gradient.c b/src/sna/sna_gradient.c index 237cf57b..3f0d7a5a 100644 --- a/src/sna/sna_gradient.c +++ b/src/sna/sna_gradient.c @@ -447,11 +447,15 @@ void sna_gradients_close(struct sna *sna) DBG(("%s\n", __FUNCTION__)); for (i = 0; i < 256; i++) { - if (sna->render.alpha_cache.bo[i]) + if (sna->render.alpha_cache.bo[i]) { kgem_bo_destroy(&sna->kgem, sna->render.alpha_cache.bo[i]); + sna->render.alpha_cache.bo[i] = NULL; + } } - if (sna->render.alpha_cache.cache_bo) + if (sna->render.alpha_cache.cache_bo) { kgem_bo_destroy(&sna->kgem, sna->render.alpha_cache.cache_bo); + sna->render.alpha_cache.cache_bo = NULL; + } if (sna->render.solid_cache.cache_bo) kgem_bo_destroy(&sna->kgem, sna->render.solid_cache.cache_bo); |