app: Fix corruption while in use of imported uri

This commit is contained in:
Mukund Sivaraman 2011-05-07 05:51:30 +05:30
parent 9e771c3160
commit 24ac01bfa9
1 changed files with 11 additions and 1 deletions

View File

@ -302,11 +302,21 @@ file_save_cmd_callback (GtkAction *action,
if (uri && export_proc) if (uri && export_proc)
{ {
char *uri_copy;
/* The memory that 'uri' points to can be freed by
file_save_dialog_save_image(), when it eventually calls
gimp_image_set_imported_uri() to reset the imported uri,
resulting in garbage. So make a duplicate of it here. */
uri_copy = g_strdup (uri);
saved = file_save_dialog_save_image (GIMP_PROGRESS (display), saved = file_save_dialog_save_image (GIMP_PROGRESS (display),
gimp, image, uri, gimp, image, uri_copy,
export_proc, export_proc,
GIMP_RUN_WITH_LAST_VALS, GIMP_RUN_WITH_LAST_VALS,
FALSE, TRUE, TRUE); FALSE, TRUE, TRUE);
g_free (uri_copy);
} }
} }
break; break;