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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2011-01-17 18:38:16 +01:00
parent 44095f3dde
commit 7f83b4e949

View file

@ -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;