xf86-video-intel: src/sna/sna_composite.c src/sna/sna_gradient.c

Chris Wilson ickle at kemper.freedesktop.org
Sun Mar 3 07:25:44 PST 2013


 src/sna/sna_composite.c |    3 ++-
 src/sna/sna_gradient.c  |    8 ++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 2583232773f1fa505e0676f07b029b29b90c8ea7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Mar 3 15:25:01 2013 +0000

    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 at chris-wilson.co.uk>

diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index e067799..916d6da 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -43,7 +43,7 @@
 
 bool sna_composite_create(struct sna *sna)
 {
-	xRenderColor color ={ 0 };
+	xRenderColor color = { 0 };
 	int error;
 
 	if (!can_render(sna))
@@ -56,6 +56,7 @@ bool sna_composite_create(struct sna *sna)
 void sna_composite_close(struct sna *sna)
 {
 	FreePicture(sna->clear, 0);
+	sna->clear = NULL;
 }
 
 static inline bool
diff --git a/src/sna/sna_gradient.c b/src/sna/sna_gradient.c
index 237cf57..3f0d7a5 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);


More information about the xorg-commit mailing list