mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-06 08:08:04 +02:00
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:
parent
aeba5acbad
commit
73e7391e6e
1 changed files with 7 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue