From b2be270bb367d925fce9b53be84771aaeb9691c7 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Thu, 8 Oct 2015 12:43:37 +0900 Subject: [PATCH] image.c: use g_clear_error, instead of g_error_free * src/image.c: Define g_clear_error, instead of g_error_free. (init_svg_functions): Resolve DLL function g_clear_error, instead of g_error_free. (svg_load_image): Use g_clear_error, instead of g_error_free. --- src/image.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/image.c b/src/image.c index 10b067f..418c656 100644 --- a/src/image.c +++ b/src/image.c @@ -9004,7 +9004,7 @@ DEF_DLL_FN (int, gdk_pixbuf_get_bits_per_sample, (const GdkPixbuf *)); DEF_DLL_FN (void, g_type_init, (void)); # endif DEF_DLL_FN (void, g_object_unref, (gpointer)); -DEF_DLL_FN (void, g_error_free, (GError *)); +DEF_DLL_FN (void, g_clear_error, (GError **)); static bool init_svg_functions (void) @@ -9042,7 +9042,7 @@ init_svg_functions (void) LOAD_DLL_FN (gobject, g_type_init); # endif LOAD_DLL_FN (gobject, g_object_unref); - LOAD_DLL_FN (glib, g_error_free); + LOAD_DLL_FN (glib, g_clear_error); return 1; } @@ -9058,7 +9058,7 @@ init_svg_functions (void) # undef gdk_pixbuf_get_pixels # undef gdk_pixbuf_get_rowstride # undef gdk_pixbuf_get_width -# undef g_error_free +# undef g_clear_error # undef g_object_unref # undef g_type_init # undef rsvg_handle_close @@ -9076,7 +9076,7 @@ init_svg_functions (void) # define gdk_pixbuf_get_pixels fn_gdk_pixbuf_get_pixels # define gdk_pixbuf_get_rowstride fn_gdk_pixbuf_get_rowstride # define gdk_pixbuf_get_width fn_gdk_pixbuf_get_width -# define g_error_free fn_g_error_free +# define g_clear_error fn_g_clear_error # define g_object_unref fn_g_object_unref # define g_type_init fn_g_type_init # define rsvg_handle_close fn_rsvg_handle_close @@ -9331,7 +9331,7 @@ svg_load_image (struct frame *f, /* Pointer to emacs frame structure. * /* FIXME: Use error->message so the user knows what is the actual problem with the image. */ image_error ("Error parsing SVG image `%s'", img->spec); - g_error_free (err); + g_clear_error (&err); return 0; } -- 2.4.3