mirror of https://github.com/GNOME/gimp.git
don't free the old filename pointer till we're all done, since we might be
* app/gimpimage.c: don't free the old filename pointer till we're all done, since we might be passed our own filename as a param and reference it after freeing. The code didn't heed it's own warning ;) (TigerT, this should fix that filename corruption bug) -Yosh
This commit is contained in:
parent
f48c866846
commit
f697f6cfab
|
@ -1,3 +1,10 @@
|
|||
Mon Oct 25 16:49:19 PDT 1999 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* app/gimpimage.c: don't free the old filename pointer till we're
|
||||
all done, since we might be passed our own filename as a param
|
||||
and reference it after freeing. The code didn't heed it's own
|
||||
warning ;) (TigerT, this should fix that filename corruption bug)
|
||||
|
||||
1999-10-25 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* app/cursorutil.h: Uncomment the inclusion of gdkcursor.h that
|
||||
|
|
|
@ -318,7 +318,8 @@ void
|
|||
gimp_image_set_filename (GimpImage *gimage,
|
||||
gchar *filename)
|
||||
{
|
||||
gchar *new_filename;
|
||||
gchar *new_filename, *old_filename;
|
||||
gboolean free_old;
|
||||
|
||||
/*
|
||||
* WARNING: this function will free the current filename even if you are
|
||||
|
@ -327,9 +328,8 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
*/
|
||||
|
||||
new_filename = g_strdup (filename);
|
||||
|
||||
if (gimage->has_filename)
|
||||
g_free (gimage->filename);
|
||||
old_filename = gimage->filename;
|
||||
free_old = gimage->has_filename;
|
||||
|
||||
if (filename && filename[0])
|
||||
{
|
||||
|
@ -342,6 +342,9 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
gimage->has_filename = FALSE;
|
||||
}
|
||||
|
||||
if (free_old)
|
||||
g_free (old_filename);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RENAME]);
|
||||
}
|
||||
|
||||
|
|
|
@ -318,7 +318,8 @@ void
|
|||
gimp_image_set_filename (GimpImage *gimage,
|
||||
gchar *filename)
|
||||
{
|
||||
gchar *new_filename;
|
||||
gchar *new_filename, *old_filename;
|
||||
gboolean free_old;
|
||||
|
||||
/*
|
||||
* WARNING: this function will free the current filename even if you are
|
||||
|
@ -327,9 +328,8 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
*/
|
||||
|
||||
new_filename = g_strdup (filename);
|
||||
|
||||
if (gimage->has_filename)
|
||||
g_free (gimage->filename);
|
||||
old_filename = gimage->filename;
|
||||
free_old = gimage->has_filename;
|
||||
|
||||
if (filename && filename[0])
|
||||
{
|
||||
|
@ -342,6 +342,9 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
gimage->has_filename = FALSE;
|
||||
}
|
||||
|
||||
if (free_old)
|
||||
g_free (old_filename);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RENAME]);
|
||||
}
|
||||
|
||||
|
|
|
@ -318,7 +318,8 @@ void
|
|||
gimp_image_set_filename (GimpImage *gimage,
|
||||
gchar *filename)
|
||||
{
|
||||
gchar *new_filename;
|
||||
gchar *new_filename, *old_filename;
|
||||
gboolean free_old;
|
||||
|
||||
/*
|
||||
* WARNING: this function will free the current filename even if you are
|
||||
|
@ -327,9 +328,8 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
*/
|
||||
|
||||
new_filename = g_strdup (filename);
|
||||
|
||||
if (gimage->has_filename)
|
||||
g_free (gimage->filename);
|
||||
old_filename = gimage->filename;
|
||||
free_old = gimage->has_filename;
|
||||
|
||||
if (filename && filename[0])
|
||||
{
|
||||
|
@ -342,6 +342,9 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
gimage->has_filename = FALSE;
|
||||
}
|
||||
|
||||
if (free_old)
|
||||
g_free (old_filename);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RENAME]);
|
||||
}
|
||||
|
||||
|
|
|
@ -318,7 +318,8 @@ void
|
|||
gimp_image_set_filename (GimpImage *gimage,
|
||||
gchar *filename)
|
||||
{
|
||||
gchar *new_filename;
|
||||
gchar *new_filename, *old_filename;
|
||||
gboolean free_old;
|
||||
|
||||
/*
|
||||
* WARNING: this function will free the current filename even if you are
|
||||
|
@ -327,9 +328,8 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
*/
|
||||
|
||||
new_filename = g_strdup (filename);
|
||||
|
||||
if (gimage->has_filename)
|
||||
g_free (gimage->filename);
|
||||
old_filename = gimage->filename;
|
||||
free_old = gimage->has_filename;
|
||||
|
||||
if (filename && filename[0])
|
||||
{
|
||||
|
@ -342,6 +342,9 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
gimage->has_filename = FALSE;
|
||||
}
|
||||
|
||||
if (free_old)
|
||||
g_free (old_filename);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RENAME]);
|
||||
}
|
||||
|
||||
|
|
|
@ -318,7 +318,8 @@ void
|
|||
gimp_image_set_filename (GimpImage *gimage,
|
||||
gchar *filename)
|
||||
{
|
||||
gchar *new_filename;
|
||||
gchar *new_filename, *old_filename;
|
||||
gboolean free_old;
|
||||
|
||||
/*
|
||||
* WARNING: this function will free the current filename even if you are
|
||||
|
@ -327,9 +328,8 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
*/
|
||||
|
||||
new_filename = g_strdup (filename);
|
||||
|
||||
if (gimage->has_filename)
|
||||
g_free (gimage->filename);
|
||||
old_filename = gimage->filename;
|
||||
free_old = gimage->has_filename;
|
||||
|
||||
if (filename && filename[0])
|
||||
{
|
||||
|
@ -342,6 +342,9 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
gimage->has_filename = FALSE;
|
||||
}
|
||||
|
||||
if (free_old)
|
||||
g_free (old_filename);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RENAME]);
|
||||
}
|
||||
|
||||
|
|
|
@ -318,7 +318,8 @@ void
|
|||
gimp_image_set_filename (GimpImage *gimage,
|
||||
gchar *filename)
|
||||
{
|
||||
gchar *new_filename;
|
||||
gchar *new_filename, *old_filename;
|
||||
gboolean free_old;
|
||||
|
||||
/*
|
||||
* WARNING: this function will free the current filename even if you are
|
||||
|
@ -327,9 +328,8 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
*/
|
||||
|
||||
new_filename = g_strdup (filename);
|
||||
|
||||
if (gimage->has_filename)
|
||||
g_free (gimage->filename);
|
||||
old_filename = gimage->filename;
|
||||
free_old = gimage->has_filename;
|
||||
|
||||
if (filename && filename[0])
|
||||
{
|
||||
|
@ -342,6 +342,9 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
gimage->has_filename = FALSE;
|
||||
}
|
||||
|
||||
if (free_old)
|
||||
g_free (old_filename);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RENAME]);
|
||||
}
|
||||
|
||||
|
|
|
@ -318,7 +318,8 @@ void
|
|||
gimp_image_set_filename (GimpImage *gimage,
|
||||
gchar *filename)
|
||||
{
|
||||
gchar *new_filename;
|
||||
gchar *new_filename, *old_filename;
|
||||
gboolean free_old;
|
||||
|
||||
/*
|
||||
* WARNING: this function will free the current filename even if you are
|
||||
|
@ -327,9 +328,8 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
*/
|
||||
|
||||
new_filename = g_strdup (filename);
|
||||
|
||||
if (gimage->has_filename)
|
||||
g_free (gimage->filename);
|
||||
old_filename = gimage->filename;
|
||||
free_old = gimage->has_filename;
|
||||
|
||||
if (filename && filename[0])
|
||||
{
|
||||
|
@ -342,6 +342,9 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
gimage->has_filename = FALSE;
|
||||
}
|
||||
|
||||
if (free_old)
|
||||
g_free (old_filename);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RENAME]);
|
||||
}
|
||||
|
||||
|
|
|
@ -318,7 +318,8 @@ void
|
|||
gimp_image_set_filename (GimpImage *gimage,
|
||||
gchar *filename)
|
||||
{
|
||||
gchar *new_filename;
|
||||
gchar *new_filename, *old_filename;
|
||||
gboolean free_old;
|
||||
|
||||
/*
|
||||
* WARNING: this function will free the current filename even if you are
|
||||
|
@ -327,9 +328,8 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
*/
|
||||
|
||||
new_filename = g_strdup (filename);
|
||||
|
||||
if (gimage->has_filename)
|
||||
g_free (gimage->filename);
|
||||
old_filename = gimage->filename;
|
||||
free_old = gimage->has_filename;
|
||||
|
||||
if (filename && filename[0])
|
||||
{
|
||||
|
@ -342,6 +342,9 @@ gimp_image_set_filename (GimpImage *gimage,
|
|||
gimage->has_filename = FALSE;
|
||||
}
|
||||
|
||||
if (free_old)
|
||||
g_free (old_filename);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gimage), gimp_image_signals[RENAME]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue