Commit 14cb9e71 authored by Michael Fulbright's avatar Michael Fulbright
Browse files

gdk-pixbuf-loader.c: Fixed init function to properly initialize all

structure members.

testpixbuf.c: Added call to close and destroy pixbuf loader properly.
parent a9c16bfa
......@@ -452,21 +452,24 @@ main (int argc, char **argv)
found_valid = TRUE;
}
}
}
pixbuf_loader = gdk_pixbuf_loader_new ();
file = fopen ("/usr/share/pixmaps/up2date.png", "r");
g_assert (file != NULL);
while (TRUE) {
val = fgetc (file);
if (val == EOF)
break;
buf = (guint) val;
if (gdk_pixbuf_loader_write (GDK_PIXBUF_LOADER (pixbuf_loader), &buf, 1) == FALSE)
break;
pixbuf_loader = gdk_pixbuf_loader_new ();
file = fopen (argv[1], "r");
g_assert (file != NULL);
while (TRUE) {
val = fgetc (file);
if (val == EOF)
break;
buf = (guint) val;
if (gdk_pixbuf_loader_write (GDK_PIXBUF_LOADER (pixbuf_loader), &buf, 1) == FALSE)
break;
}
gdk_pixbuf_loader_close (GDK_PIXBUF_LOADER (pixbuf_loader));
gtk_object_destroy (pixbuf_loader);
fclose (file);
}
fclose (file);
if (found_valid)
gtk_main ();
......
......@@ -145,6 +145,7 @@ gdk_pixbuf_loader_init (GdkPixbufLoader *loader)
priv = g_new (GdkPixbufLoaderPrivate, 1);
loader->private = priv;
priv->image_module=NULL;
priv->pixbuf = NULL;
priv->closed = FALSE;
priv->buf_offset = 0;
......
......@@ -145,6 +145,7 @@ gdk_pixbuf_loader_init (GdkPixbufLoader *loader)
priv = g_new (GdkPixbufLoaderPrivate, 1);
loader->private = priv;
priv->image_module=NULL;
priv->pixbuf = NULL;
priv->closed = FALSE;
priv->buf_offset = 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