cairo: Avoid GLib-GObject-CRITICAL from g_object_unref() on error path.
[pspp-builds.git] / src / output / cairo.c
index 94dafd886b7914356b856701c09e6564269426b1..3584f30f575c4ef680d1d232ed3350f3e9e51ad3 100644 (file)
@@ -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. */