[PATCH 3/4] glamor: Make glamor_destroy_textured_pixmap idempotent

Michel Dänzer michel at daenzer.net
Wed Dec 10 23:50:39 PST 2014


From: Michel Dänzer <michel.daenzer at amd.com>

For robustness against drivers which may call both
glamor_(egl_)destroy_textured_pixmap and glamor_destroy_pixmap.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 glamor/glamor.c     | 1 +
 glamor/glamor_fbo.c | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/glamor/glamor.c b/glamor/glamor.c
index cbd0e02..d1aa1cf 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -226,6 +226,7 @@ glamor_destroy_textured_pixmap(PixmapPtr pixmap)
             glamor_egl_destroy_pixmap_image(pixmap);
 #endif
             glamor_pixmap_destroy_fbo(pixmap_priv);
+            glamor_set_pixmap_private(pixmap, NULL);
         }
     }
 }
diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
index 4273826..d2aabb2 100644
--- a/glamor/glamor_fbo.c
+++ b/glamor/glamor_fbo.c
@@ -540,8 +540,6 @@ glamor_pixmap_destroy_fbo(glamor_pixmap_private *priv)
         if (fbo)
             glamor_destroy_fbo(fbo);
     }
-
-    free(priv);
 }
 
 Bool
-- 
2.1.3



More information about the xorg-devel mailing list