[PATCH 1/3] Only free Render filter names on last screen close

Keith Packard keithp at keithp.com
Tue Aug 7 17:49:46 PDT 2012


Hotplugging screens causes the render filter names to get freed while
still in use; wait for the last core screen to be closed before
freeing them. That only happens at server reset, when we want them to
be freed.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 render/filter.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/render/filter.c b/render/filter.c
index 8c401ee..019ea7f 100644
--- a/render/filter.c
+++ b/render/filter.c
@@ -273,7 +273,10 @@ PictureResetFilters(ScreenPtr pScreen)
 
     free(ps->filters);
     free(ps->filterAliases);
-    PictureFreeFilterIds();
+
+    /* Free the filters when the last screen is closed */
+    if (pScreen->myNum == 0)
+        PictureFreeFilterIds();
 }
 
 int
-- 
1.7.10.4



More information about the xorg-devel mailing list