From 7f83b4e949b85fc604e9a7841c566eebd0aa1452 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 17 Jan 2011 18:38:16 +0100 Subject: [PATCH] xcb: Don't finish snapshots when they are detached Some code might own a reference to the snapshot when it is detached. For this reason, we shouldn't finish the snapshot except when its reference count drops to zero. This avoids destroying source patterns which get evicted from the cache while acquiring the mask. Fixes xcb-stress-cache. Big "thank you" to Andrea Canciani for helping in figuring this one out. Signed-off-by: Uli Schlachter --- src/cairo-xcb-surface-render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c index 1a719968c..425473aef 100644 --- a/src/cairo-xcb-surface-render.c +++ b/src/cairo-xcb-surface-render.c @@ -1308,7 +1308,7 @@ _cairo_xcb_surface_picture (cairo_xcb_surface_t *target, _cairo_surface_attach_snapshot (source, &picture->base, - cairo_surface_finish); + NULL); setup_picture: filter = pattern->base.filter;