From d6ea5a0c84b5b758dbdab6d803f281f688db41e7 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 5 Feb 2010 20:11:33 -0800 Subject: [PATCH] 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. --- src/output/cairo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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. */ -- 2.30.2