xlib/shm: Explicitly release shm surface if we do not own the pixmap

In this case we want to prevent the short-circuiting of the flush of the
ShmPixmap that is ordinarily performed during finish().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-09-08 16:39:05 +01:00
parent 558f0a5ab4
commit f864e2d70f

View file

@ -377,11 +377,18 @@ _cairo_xlib_surface_finish (void *abstract_surface)
XRenderFreePicture (display->display, surface->embedded_source.picture);
if (surface->picture)
XRenderFreePicture (display->display, surface->picture);
if (surface->shm) {
/* Force the flush for an external surface */
if (!surface->owns_pixmap)
cairo_surface_flush (surface->shm);
cairo_surface_finish (surface->shm);
cairo_surface_destroy (surface->shm);
}
if (surface->owns_pixmap)
XFreePixmap (display->display, surface->drawable);
cairo_surface_destroy (surface->shm);
cairo_device_release (&display->base);
return status;