xcb: Handle SHM exhaustion via falling back

When we couldn't get an image from the X11 server via SHM because we ran out
shared memory, we should try again via a normal GetImage request.

Fixes: xcb-huge-image-shm

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2011-08-18 15:20:35 +02:00
parent aeba5acbad
commit 73e7391e6e

View file

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