Commit b29fc29b authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

only create the temporary file if there is a parasite to load.

2005-06-06  Sven Neumann  <sven@gimp.org>

	* plug-ins/gfig/gfig.c (gfig_load_from_parasite): only create the
	temporary file if there is a parasite to load.
parent 365f7926
2005-06-06 Sven Neumann <sven@gimp.org>
* plug-ins/gfig/gfig.c (gfig_load_from_parasite): only create the
temporary file if there is a parasite to load.
2005-06-06 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcellrendererdashes.c: removed unused variable.
......
......@@ -741,7 +741,12 @@ gfig_load_from_parasite (void)
GimpParasite *parasite;
GFigObj *gfig;
parasite = gimp_drawable_parasite_find (gfig_context->drawable_id, "gfig");
if (! parasite)
return NULL;
fname = gimp_temp_name ("gfigtmp");
fp = g_fopen (fname, "w");
if (!fp)
{
......@@ -751,23 +756,21 @@ gfig_load_from_parasite (void)
return NULL;
}
parasite = gimp_drawable_parasite_find (gfig_context->drawable_id, "gfig");
if (!parasite)
return NULL;
fwrite (gimp_parasite_data (parasite),
sizeof (guchar),
gimp_parasite_data_size (parasite),
fp);
fclose (fp);
gimp_parasite_free (parasite);
fclose (fp);
gfig = gfig_load (fname, "(none)");
g_unlink (fname);
return (gfig);
g_free (fname);
return gfig;
}
void
......
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