From: Ben Pfaff Date: Sat, 6 Feb 2010 04:11:33 +0000 (-0800) Subject: cairo: Avoid GLib-GObject-CRITICAL from g_object_unref() on error path. X-Git-Tag: v0.7.4~33 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6ea5a0c84b5b758dbdab6d803f281f688db41e7;p=pspp-builds.git cairo: Avoid GLib-GObject-CRITICAL from g_object_unref() on error path. This could be triggered by an error creating the output file, e.g. by tests/bugs/unwritable-dir.sh. --- diff --git a/src/output/cairo.c b/src/output/cairo.c index 94dafd88..3584f30f 100644 --- a/src/output/cairo.c +++ b/src/output/cairo.c @@ -895,7 +895,8 @@ free_font (struct xr_font *font) if (font->desc != NULL) pango_font_description_free (font->desc); pango_font_metrics_unref (font->metrics); - g_object_unref (font->layout); + if (font->layout != NULL) + g_object_unref (font->layout); } /* Cairo driver class. */