Commit 8474c4e2 authored by CDT 1998  Larry Ewing's avatar CDT 1998 Larry Ewing Committed by Larry Ewing
Browse files

move the mru and docindex calls to before the call to

Mon Aug 24 13:41:49 CDT 1998  Larry Ewing  <lewing@gimp.org>

	* app/fileops.c (file_save): move the mru and docindex calls to
	before the call to gimp_image_set_filename so that they are still
	accessing valid memory.  Fixes the filename corruption seen in
	these interfaces.
	* app/gimpimage.c: added a warning about the side effect that
	caused the above bug.
parent 2ada61e0
Mon Aug 24 13:41:49 CDT 1998 Larry Ewing <lewing@gimp.org>
* app/fileops.c (file_save): move the mru and docindex calls to
before the call to gimp_image_set_filename so that they are still
accessing valid memory. Fixes the filename corruption seen in
these interfaces.
* app/gimpimage.c: added a warning about the side effect that
caused the above bug.
Mon Aug 24 09:34:37 PDT 1998 Manish Singh <yosh@gimp.org>
* plug-ins/depthmerge.c
......
......@@ -262,7 +262,14 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
{
char *new_filename;
/*
* WARNING: this function will free the current filename even if you are
* setting it to itself so any pointer you hold to the filename will be
* invalid after this call. So please use with care.
*/
new_filename = g_strdup (filename);
if (gimage->has_filename)
g_free (gimage->filename);
......
......@@ -262,7 +262,14 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
{
char *new_filename;
/*
* WARNING: this function will free the current filename even if you are
* setting it to itself so any pointer you hold to the filename will be
* invalid after this call. So please use with care.
*/
new_filename = g_strdup (filename);
if (gimage->has_filename)
g_free (gimage->filename);
......
......@@ -262,7 +262,14 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
{
char *new_filename;
/*
* WARNING: this function will free the current filename even if you are
* setting it to itself so any pointer you hold to the filename will be
* invalid after this call. So please use with care.
*/
new_filename = g_strdup (filename);
if (gimage->has_filename)
g_free (gimage->filename);
......
......@@ -262,7 +262,14 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
{
char *new_filename;
/*
* WARNING: this function will free the current filename even if you are
* setting it to itself so any pointer you hold to the filename will be
* invalid after this call. So please use with care.
*/
new_filename = g_strdup (filename);
if (gimage->has_filename)
g_free (gimage->filename);
......
......@@ -262,7 +262,14 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
{
char *new_filename;
/*
* WARNING: this function will free the current filename even if you are
* setting it to itself so any pointer you hold to the filename will be
* invalid after this call. So please use with care.
*/
new_filename = g_strdup (filename);
if (gimage->has_filename)
g_free (gimage->filename);
......
......@@ -262,7 +262,14 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
{
char *new_filename;
/*
* WARNING: this function will free the current filename even if you are
* setting it to itself so any pointer you hold to the filename will be
* invalid after this call. So please use with care.
*/
new_filename = g_strdup (filename);
if (gimage->has_filename)
g_free (gimage->filename);
......
......@@ -262,7 +262,14 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
{
char *new_filename;
/*
* WARNING: this function will free the current filename even if you are
* setting it to itself so any pointer you hold to the filename will be
* invalid after this call. So please use with care.
*/
new_filename = g_strdup (filename);
if (gimage->has_filename)
g_free (gimage->filename);
......
......@@ -300,7 +300,7 @@ static GSList *save_procs = NULL;
static PlugInProcDef *load_file_proc = NULL;
static PlugInProcDef *save_file_proc = NULL;
static GimpImage* the_gimage;
static GimpImage* the_gimage = NULL;
#define FILE_ERR_MESSAGE(str) G_STMT_START{ \
if (message_handler == MESSAGE_BOX) \
......@@ -813,11 +813,12 @@ file_save (GimpImage* gimage,
/* set this image to clean */
gimage_clean_all (gimage);
/* set the image title */
gimage_set_filename (gimage, filename);
idea_add( filename );
/* these calls must come before the call to gimage_set_filename */
idea_add (filename);
menus_last_opened_add (filename);
/* set the image title */
gimp_image_set_filename (gimage, filename);
}
g_free (return_vals);
......
......@@ -262,7 +262,14 @@ gimp_image_set_filename (GimpImage *gimage, char *filename)
{
char *new_filename;
/*
* WARNING: this function will free the current filename even if you are
* setting it to itself so any pointer you hold to the filename will be
* invalid after this call. So please use with care.
*/
new_filename = g_strdup (filename);
if (gimage->has_filename)
g_free (gimage->filename);
......
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