[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.
This commit is contained in:
Luo jinghua 2007-05-27 17:09:49 +08:00
parent 69bf823db1
commit 4da50dfa02

View file

@ -2887,6 +2887,7 @@ _cairo_xlib_surface_emit_glyphs (cairo_xlib_surface_t *dst,
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;