don't leak the message.

2006-09-19  Sven Neumann  <sven@gimp.org>

	* app/core/gimp.c (gimp_message): don't leak the message.

	* app/file/file-utils.c (file_utils_find_proc): clear the error
	if we found a file procedure by matching the file extension.

	* plug-ins/common/png.c (load_image): don't call gimp_quit() if
	opening the file fails but return with GIMP_PDB_EXECUTION_ERROR.
This commit is contained in:
Sven Neumann 2006-09-19 14:26:48 +00:00 committed by Sven Neumann
parent db51ce3a49
commit 3dc50859a7
4 changed files with 26 additions and 5 deletions

View File

@ -1,3 +1,13 @@
2006-09-19 Sven Neumann <sven@gimp.org>
* app/core/gimp.c (gimp_message): don't leak the message.
* app/file/file-utils.c (file_utils_find_proc): clear the error
if we found a file procedure by matching the file extension.
* plug-ins/common/png.c (load_image): don't call gimp_quit() if
opening the file fails but return with GIMP_PDB_EXECUTION_ERROR.
2006-09-19 Michael Natterer <mitch@gimp.org>
Fix disabling of deprecated procedures (bug #345733):

View File

@ -1008,4 +1008,6 @@ gimp_message (Gimp *gimp,
va_end (args);
gimp_show_message (gimp, progress, NULL, message);
g_free (message);
}

View File

@ -274,9 +274,18 @@ file_utils_find_proc (GSList *procs,
/* As a last resort, try matching by name */
file_proc = file_proc_find_by_name (all_procs, uri, FALSE);
if (! file_proc && error && *error == NULL)
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Unknown file type"));
if (file_proc)
{
/* we found a procedure, clear error that might have been set */
g_clear_error (error);
}
else
{
/* set an error message unless one was already set */
if (error && *error == NULL)
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Unknown file type"));
}
return file_proc;
}

View File

@ -649,7 +649,7 @@ load_image (const gchar *filename,
{
g_message (_("Could not open '%s' for reading: %s"),
gimp_filename_to_utf8 (filename), g_strerror (errno));
gimp_quit ();
return -1;
}
png_init_io (pp, fp);
@ -768,7 +768,7 @@ load_image (const gchar *filename,
{
g_message ("Could not create new image for '%s'",
gimp_filename_to_utf8 (filename));
gimp_quit ();
return -1;
}
/*