sna: Wrap glyph composition with sigtrap handling
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 28 Nov 2013 13:14:27 +0000 (13:14 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 28 Nov 2013 13:14:27 +0000 (13:14 +0000)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_glyphs.c

index 9b272ef..caa4649 100644 (file)
@@ -1140,6 +1140,11 @@ glyphs_via_mask(struct sna *sna,
                if (mask_image == NULL)
                        goto err_pixmap;
 
+               if (sigtrap_get()) {
+                       pixman_image_unref(mask_image);
+                       goto err_pixmap;
+               }
+
                memset(pixmap->devPrivate.ptr, 0, pixmap->devKind*height);
 #if HAS_PIXMAN_GLYPHS
                if (sna->render.glyph_cache) {
@@ -1276,6 +1281,8 @@ next_image:
                } while (--nlist);
                pixman_image_unref(mask_image);
 
+               sigtrap_put();
+
                mask = CreatePicture(0, &pixmap->drawable,
                                     format, CPComponentAlpha,
                                     &component_alpha, serverClient, &error);
@@ -2038,6 +2045,11 @@ glyphs_via_image(struct sna *sna,
        if (mask_image == NULL)
                goto err_pixmap;
 
+       if (sigtrap_get()) {
+               pixman_image_unref(mask_image);
+               goto err_pixmap;
+       }
+
        memset(pixmap->devPrivate.ptr, 0, pixmap->devKind*height);
 #if HAS_PIXMAN_GLYPHS
        if (sna->render.glyph_cache) {
@@ -2173,6 +2185,7 @@ next_image:
                        list++;
                } while (--nlist);
        pixman_image_unref(mask_image);
+       sigtrap_put();
 
        component_alpha = NeedsComponent(format->format);