[cairo-commit] src/cairo-xlib-surface.c

罗晶华 Jinghua Luo jinghua at kemper.freedesktop.org
Sun May 27 02:11:21 PDT 2007

 src/cairo-xlib-surface.c |    1 +
 1 files changed, 1 insertion(+)

New commits:
diff-tree 4da50dfa02d7c03c32ee20c15f8304eafa0844e0 (from 69bf823db1b256f19487d2f002e7b0811859e58e)
Author: Luo jinghua <sunmoon1997 at gmail.com>
Date:   Sun May 27 17:09:49 2007 +0800

    [cairo-xlib-surface]: flush work queue before sending glyphs to X server.
      After introducing a work queue for deferred destruction of X resource
    my firefox crashes over and over again because XRenderFreeGlyphs is trying
    to free a non-exist glyph (already freed). The problematic call sequence is
    something like below:
      XRenderAddGlyphs (20990204, 20069)
      XRenderAddGlyphs (20990204, 20069)
      XRenderFreeGlyphs (20990204, 20069)
      XRenderFreeGlyphs (20990204, 20069)
    You can see the two add/free glyphs is interlaced. And obviously, we'll crash
    at the last one. To fix this bug, we must be ensure here's no pending work
    to free the glyph that we want to sent.

diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 103757b..db5c155 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -2887,6 +2887,7 @@ _cairo_xlib_surface_emit_glyphs (cairo_x
     int request_size = 0;
     _cairo_xlib_surface_ensure_dst_picture (dst);
+    _cairo_xlib_display_notify (dst->screen_info->display);
     for (i = 0; i < num_glyphs; i++) {
 	int this_x, this_y;

More information about the cairo-commit mailing list