diff options
-rw-r--r-- | src/cairo-xcb-surface.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c index c3df5ed5..ebea5ff7 100644 --- a/src/cairo-xcb-surface.c +++ b/src/cairo-xcb-surface.c @@ -348,8 +348,13 @@ _get_image (cairo_xcb_surface_t *surface, if (use_shm) { image = _get_shm_image (surface, x, y, width, height); if (image) { - _cairo_xcb_connection_release (connection); - return image; + /* XXX This only wants to catch SHM exhaustion, + * not other allocation failures. */ + if (image->status != CAIRO_STATUS_NO_MEMORY) { + _cairo_xcb_connection_release (connection); + return image; + } + cairo_surface_destroy (image); } } |