aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaiki Ueno2015-10-08 12:43:37 +0900
committerDaiki Ueno2015-10-09 10:02:03 +0900
commitb3154551bc501ba46983ce2cc943100cfb803f8c (patch)
tree46ed8efd471c2df6216d2d201d3ad1096c18b31c /src
parenta00634c20988215a47ec6c00cea85a2eac162597 (diff)
downloademacs-b3154551bc501ba46983ce2cc943100cfb803f8c.tar.gz
emacs-b3154551bc501ba46983ce2cc943100cfb803f8c.zip
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 symbol g_clear_error instead of g_error_free. (svg_load_image): Use g_clear_error instead of g_error_free, to suppress GLib warnings when ERR is not set. See bug#21641.
Diffstat (limited to 'src')
-rw-r--r--src/image.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/image.c b/src/image.c
index 4d1d2014258..c702782b64b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8991,7 +8991,7 @@ DEF_DLL_FN (int, gdk_pixbuf_get_bits_per_sample, (const GdkPixbuf *));
8991DEF_DLL_FN (void, g_type_init, (void)); 8991DEF_DLL_FN (void, g_type_init, (void));
8992# endif 8992# endif
8993DEF_DLL_FN (void, g_object_unref, (gpointer)); 8993DEF_DLL_FN (void, g_object_unref, (gpointer));
8994DEF_DLL_FN (void, g_error_free, (GError *)); 8994DEF_DLL_FN (void, g_clear_error, (GError **));
8995 8995
8996static bool 8996static bool
8997init_svg_functions (void) 8997init_svg_functions (void)
@@ -9029,7 +9029,7 @@ init_svg_functions (void)
9029 LOAD_DLL_FN (gobject, g_type_init); 9029 LOAD_DLL_FN (gobject, g_type_init);
9030# endif 9030# endif
9031 LOAD_DLL_FN (gobject, g_object_unref); 9031 LOAD_DLL_FN (gobject, g_object_unref);
9032 LOAD_DLL_FN (glib, g_error_free); 9032 LOAD_DLL_FN (glib, g_clear_error);
9033 9033
9034 return 1; 9034 return 1;
9035} 9035}
@@ -9045,7 +9045,7 @@ init_svg_functions (void)
9045# undef gdk_pixbuf_get_pixels 9045# undef gdk_pixbuf_get_pixels
9046# undef gdk_pixbuf_get_rowstride 9046# undef gdk_pixbuf_get_rowstride
9047# undef gdk_pixbuf_get_width 9047# undef gdk_pixbuf_get_width
9048# undef g_error_free 9048# undef g_clear_error
9049# undef g_object_unref 9049# undef g_object_unref
9050# undef g_type_init 9050# undef g_type_init
9051# undef rsvg_handle_close 9051# undef rsvg_handle_close
@@ -9063,7 +9063,7 @@ init_svg_functions (void)
9063# define gdk_pixbuf_get_pixels fn_gdk_pixbuf_get_pixels 9063# define gdk_pixbuf_get_pixels fn_gdk_pixbuf_get_pixels
9064# define gdk_pixbuf_get_rowstride fn_gdk_pixbuf_get_rowstride 9064# define gdk_pixbuf_get_rowstride fn_gdk_pixbuf_get_rowstride
9065# define gdk_pixbuf_get_width fn_gdk_pixbuf_get_width 9065# define gdk_pixbuf_get_width fn_gdk_pixbuf_get_width
9066# define g_error_free fn_g_error_free 9066# define g_clear_error fn_g_clear_error
9067# define g_object_unref fn_g_object_unref 9067# define g_object_unref fn_g_object_unref
9068# define g_type_init fn_g_type_init 9068# define g_type_init fn_g_type_init
9069# define rsvg_handle_close fn_rsvg_handle_close 9069# define rsvg_handle_close fn_rsvg_handle_close
@@ -9318,7 +9318,7 @@ svg_load_image (struct frame *f, /* Pointer to emacs frame structure. *
9318 /* FIXME: Use error->message so the user knows what is the actual 9318 /* FIXME: Use error->message so the user knows what is the actual
9319 problem with the image. */ 9319 problem with the image. */
9320 image_error ("Error parsing SVG image `%s'", img->spec); 9320 image_error ("Error parsing SVG image `%s'", img->spec);
9321 g_error_free (err); 9321 g_clear_error (&err);
9322 return 0; 9322 return 0;
9323} 9323}
9324 9324