summaryrefslogtreecommitdiff
path: root/src/image.c
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2014-03-27 02:17:54 +0100
committerJuanma Barranquero <lekktu@gmail.com>2014-03-27 02:17:54 +0100
commitb9b37dd04e6f60ef16738efe1b396a9e0a461d86 (patch)
tree8d2a7023465f02ba361ce562f8583014a66c0bfa /src/image.c
parent8ab9876a815b82107f4640e597dac6710a530848 (diff)
downloademacs-b9b37dd04e6f60ef16738efe1b396a9e0a461d86.tar.gz
src/image.c: Avoid partial load of SVG libraries.
(init_svg_functions): When loading SVG-related libraries, free already loaded libraries if the initialization fails. (rsvg_handle_set_size_callback): Remove declaration, unused.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/image.c b/src/image.c
index 6b33e1de8a1..29a04e7da81 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8661,7 +8661,6 @@ DEF_IMGLIB_FN (void, rsvg_handle_get_dimensions, (RsvgHandle *, RsvgDimensionDat
DEF_IMGLIB_FN (gboolean, rsvg_handle_write, (RsvgHandle *, const guchar *, gsize, GError **));
DEF_IMGLIB_FN (gboolean, rsvg_handle_close, (RsvgHandle *, GError **));
DEF_IMGLIB_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *));
-DEF_IMGLIB_FN (void *, rsvg_handle_set_size_callback, (RsvgHandle *, RsvgSizeFunc, gpointer, GDestroyNotify));
DEF_IMGLIB_FN (int, gdk_pixbuf_get_width, (const GdkPixbuf *));
DEF_IMGLIB_FN (int, gdk_pixbuf_get_height, (const GdkPixbuf *));
@@ -8683,13 +8682,18 @@ Lisp_Object Qgdk_pixbuf, Qglib, Qgobject;
static bool
init_svg_functions (void)
{
- HMODULE library, gdklib, glib, gobject;
+ HMODULE library, gdklib = NULL, glib = NULL, gobject = NULL;
if (!(glib = w32_delayed_load (Qglib))
|| !(gobject = w32_delayed_load (Qgobject))
|| !(gdklib = w32_delayed_load (Qgdk_pixbuf))
|| !(library = w32_delayed_load (Qsvg)))
- return 0;
+ {
+ if (gdklib) FreeLibrary (gdklib);
+ if (gobject) FreeLibrary (gobject);
+ if (glib) FreeLibrary (glib);
+ return 0;
+ }
LOAD_IMGLIB_FN (library, rsvg_handle_new);
LOAD_IMGLIB_FN (library, rsvg_handle_get_dimensions);