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.
This commit is contained in:
parent
8ab9876a81
commit
b9b37dd04e
2 changed files with 13 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
2014-03-27 Juanma Barranquero <lekktu@gmail.com>
|
||||
|
||||
* image.c (init_svg_functions): When loading SVG-related libraries,
|
||||
free already loaded libraries if the initialization fails.
|
||||
(rsvg_handle_set_size_callback): Remove declaration, unused.
|
||||
|
||||
2014-03-26 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Fix core dump in char-equal (Bug#17011).
|
||||
|
|
10
src/image.c
10
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);
|
||||
|
|
Loading…
Add table
Reference in a new issue