Commit add34cc6 authored by Dom Lachowicz's avatar Dom Lachowicz

rsvg_init(), rsvg_term() to cu down on libxml2 leaking memory out the butt...

parent 481ff23b
2004-09-10 Dom Lachowicz <cinamod@hotmail.com>
* rsvg.[ch]: rsvg_init(), rsvg_term(). Cuts down on libxml2 memory leaks
* test-*.c: Use above fns
2004-08-31 Caleb Moore <c.moore@student.unsw.edu.au>
* rsvg-text.c: made text not cause crashes
......
......@@ -1873,3 +1873,27 @@ rsvg_handle_free (RsvgHandle *handle)
(*handle->free) (handle);
}
/**
* rsvg_init:
*
* Initializes librsvg
* Since: 2.9
**/
void
rsvg_init (void)
{
g_type_init ();
xmlInitParser ();
}
/**
* rsvg_term:
*
* De-initializes librsvg
* Since: 2.9
**/
void
rsvg_term (void)
{
xmlCleanupParser ();
}
......@@ -59,6 +59,9 @@ void rsvg_set_default_dpi (double dpi);
void rsvg_handle_set_dpi (RsvgHandle * handle, double dpi);
#endif
void rsvg_init (void);
void rsvg_term (void);
void rsvg_set_default_dpi_x_y (double dpi_x, double dpi_y);
void rsvg_handle_set_dpi_x_y (RsvgHandle * handle, double dpi_x, double dpi_y);
......
......@@ -587,6 +587,7 @@ main (int argc, char **argv)
/* initialize gtk+ */
gtk_init (&argc, &argv) ;
rsvg_init ();
rsvg_set_default_dpi_x_y (dpi_x, dpi_y);
......@@ -686,6 +687,7 @@ main (int argc, char **argv)
g_object_unref (G_OBJECT (info.pixbuf));
g_byte_array_free (info.svg_bytes, TRUE);
rsvg_term ();
return 0;
}
......@@ -93,7 +93,7 @@ main (int argc, const char **argv)
return 1;
}
g_type_init ();
rsvg_init ();
fprintf (stdout, "File '%s'\n", args[0]);
......@@ -119,5 +119,7 @@ main (int argc, const char **argv)
g_timer_elapsed (timer, NULL) / count);
g_timer_destroy(timer);
rsvg_term ();
return 0;
}
......@@ -93,7 +93,7 @@ main (int argc, const char **argv)
else if (strstr (format, "jpg") != NULL) /* backward compatibility */
format = "jpeg";
g_type_init ();
rsvg_init ();
rsvg_set_default_dpi_x_y (dpi_x, dpi_y);
......@@ -130,5 +130,7 @@ main (int argc, const char **argv)
g_object_unref (G_OBJECT (pixbuf));
poptFreeContext (popt_context);
rsvg_term();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment