From 072a483ad72f1c34616e880769158a9c2ae44948 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 21 Oct 2012 14:58:42 +0200 Subject: [PATCH] Get svg error message --- draw.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/draw.c b/draw.c index d90d0e9..625c0bd 100644 --- a/draw.c +++ b/draw.c @@ -245,13 +245,13 @@ LoadSVG (char *dir, int color, int piece) char buf[MSG_SIZ]; RsvgHandle *svg=svgPieces[color][piece]; RsvgDimensionData svg_dimensions; - GError **svgerror=NULL; + GError *svgerror=NULL; cairo_surface_t *img; cairo_t *cr; snprintf(buf, MSG_SIZ, "%s/%s%s.svg", dir, color ? "Black" : "White", pngPieceNames[piece]); - if(svg || *dir && (svg = rsvg_handle_new_from_file(buf, svgerror))) { + if(svg || *dir && (svg = rsvg_handle_new_from_file(buf, &svgerror))) { rsvg_handle_get_dimensions(svg, &svg_dimensions); img = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, squareSize, squareSize); @@ -267,6 +267,8 @@ LoadSVG (char *dir, int color, int piece) return svg; } + if(svgerror) + g_error_free(svgerror); return NULL; } -- 1.7.0.4