diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-11 21:03:00 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-11 21:06:53 +0100 |
commit | e6309c6307179388c5de938bffdb44b83b694f28 (patch) | |
tree | e7ab3cbc507268a9e11483a5ba6ab4edfac650a9 /src/cairo-xcb-screen.c | |
parent | e425c44e9c4c1796ccc3557a0368cf3b3a685a31 (diff) | |
download | cairo-e6309c6307179388c5de938bffdb44b83b694f28.tar.gz |
xcb: Use normal finish to decouple from surface cache.
Hook into the standard finishing process for a more robust cache removal
mechanism. firefox was able to trigger some double free asserts
otherwise.
Diffstat (limited to 'src/cairo-xcb-screen.c')
-rw-r--r-- | src/cairo-xcb-screen.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cairo-xcb-screen.c b/src/cairo-xcb-screen.c index c0235e316..e4e622572 100644 --- a/src/cairo-xcb-screen.c +++ b/src/cairo-xcb-screen.c @@ -116,7 +116,8 @@ _surface_cache_entry_destroy (void *closure) { struct pattern_cache_entry *entry = closure; - cairo_surface_finish (entry->picture); + if (entry->picture->snapshot_of != NULL) + _cairo_surface_detach_snapshot (entry->picture); cairo_surface_destroy (entry->picture); _cairo_freelist_free (&entry->screen->pattern_cache_entry_freelist, entry); } @@ -381,6 +382,7 @@ _cairo_xcb_screen_store_surface_picture (cairo_xcb_screen_t *screen, status = _cairo_cache_insert (&screen->surface_pattern_cache, &entry->key); if (unlikely (status)) { + cairo_surface_destroy (picture); _cairo_freelist_free (&screen->pattern_cache_entry_freelist, entry); return status; } |