forked from AuroraMiddleware/gtk
gdk-pixbuf-loader.c: Fixed init function to properly initialize all
structure members. testpixbuf.c: Added call to close and destroy pixbuf loader properly.
This commit is contained in:
parent
a9c16bfabd
commit
14cb9e710a
@ -452,10 +452,9 @@ main (int argc, char **argv)
|
||||
found_valid = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pixbuf_loader = gdk_pixbuf_loader_new ();
|
||||
file = fopen ("/usr/share/pixmaps/up2date.png", "r");
|
||||
file = fopen (argv[1], "r");
|
||||
g_assert (file != NULL);
|
||||
|
||||
while (TRUE) {
|
||||
@ -466,8 +465,12 @@ main (int argc, char **argv)
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user