}
code = svgtiny_parse(diagram, buffer, bytecount, "", width, height);
- free(buffer);
if (code != svgtiny_OK) {
switch (code) {
context->updated_func = updated_func;
context->user_data = user_data;
- /* YOLO, no error checking */
- context->svg_data = g_malloc(0);
+ context->svg_data = NULL;
context->svg_data_size = 0;
return context;
}
-/*
-static void emit_size(SvgTinyContext* context, GdkPixbuf* pixbuf) {
- int w = gdk_pixbuf_get_width(pixbuf);
- int h = gdk_pixbuf_get_height(pixbuf);
- if (context->size_func != NULL) {
- (*context->size_func)(&w, &h, context->user_data);
- }
-}
-*/
-
-
static gboolean gdk_pixbuf_stop_load(gpointer data, GError **error) {
SvgTinyContext* context = (SvgTinyContext*)data;
GdkPixbuf* pixbuf = NULL;
&sub_error);
if (pixbuf != NULL) {
- /*emit_size(context, pixbuf);*/
emit_prepared(context, pixbuf);
emit_updated(context, pixbuf);
g_object_unref(pixbuf);
g_propagate_error(error, sub_error);
result = FALSE;
}
+ g_free(context->svg_data);
g_free(context);
return result;