Commit d7c90b6d authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

check for NULL pointer

2000-12-11  Sven Neumann  <sven@gimp.org>

	* app/channel.c (channel_invalidate_previews): check for NULL pointer

	* app/fileops.c: if saving and loading images at the same time, the
	PDB obviously manages to mangle return values. By checking the
	validity of the returned image id we avoid to crash as described in
	bug #26788.

	* app/module_db.c: unload modules from the idle_loop as suggested
	by Austin in #5745.
parent ec5a515e
2000-12-11 Sven Neumann <sven@gimp.org>
* app/channel.c (channel_invalidate_previews): check for NULL pointer
* app/fileops.c: if saving and loading images at the same time, the
PDB obviously manages to mangle return values. By checking the
validity of the returned image id we avoid to crash as described in
bug #26788.
* app/module_db.c: unload modules from the idle_loop as suggested
by Austin in #5745.
Mon Dec 11 20:29:55 GMT 2000 Adam D. Moss <adam@gimp.org>
 
* plug-ins/common/gee.c: v1.05: Sub-pixel jitter is
......
......@@ -575,6 +575,8 @@ channel_invalidate_previews (GimpImage* gimage)
GSList * tmp;
Channel * channel;
g_return_if_fail (gimage != NULL);
tmp = gimage->channels;
while (tmp)
......
......@@ -575,6 +575,8 @@ channel_invalidate_previews (GimpImage* gimage)
GSList * tmp;
Channel * channel;
g_return_if_fail (gimage != NULL);
tmp = gimage->channels;
while (tmp)
......
......@@ -575,6 +575,8 @@ channel_invalidate_previews (GimpImage* gimage)
GSList * tmp;
Channel * channel;
g_return_if_fail (gimage != NULL);
tmp = gimage->channels;
while (tmp)
......
......@@ -163,6 +163,7 @@ static void mod_load (ModuleInfo *mod,
gboolean verbose);
static void mod_unload (ModuleInfo *mod,
gboolean verbose);
static gboolean mod_idle_unref (ModuleInfo *mod);
static ModuleInfo * module_find_by_path (const gchar *fullpath);
#ifdef DUMP_DB
......@@ -722,9 +723,17 @@ mod_unload (ModuleInfo *mod,
* callback is called before the unload function returns). */
gimp_module_ref (mod);
mod->unload (mod->info->shutdown_data, mod_unload_completed_callback, mod);
gimp_module_unref (mod);
gtk_idle_add ((GtkFunction) mod_idle_unref, (gpointer) mod);
}
static gboolean
mod_idle_unref (ModuleInfo *mod)
{
gimp_module_unref (mod);
return FALSE;
}
#ifdef DUMP_DB
static void
......
......@@ -800,8 +800,13 @@ file_open_image (gchar *filename,
if (*status == PDB_SUCCESS && gimage_id != -1)
{
layer_invalidate_previews (gimage_get_ID (gimage_id));
channel_invalidate_previews (gimage_get_ID (gimage_id));
GimpDrawable *drawable = gimage_get_ID (gimage_id);
if (drawable)
{
layer_invalidate_previews (drawable);
channel_invalidate_previews (drawable);
}
return pdb_id_to_image (gimage_id);
}
......
......@@ -575,6 +575,8 @@ channel_invalidate_previews (GimpImage* gimage)
GSList * tmp;
Channel * channel;
g_return_if_fail (gimage != NULL);
tmp = gimage->channels;
while (tmp)
......
......@@ -163,6 +163,7 @@ static void mod_load (ModuleInfo *mod,
gboolean verbose);
static void mod_unload (ModuleInfo *mod,
gboolean verbose);
static gboolean mod_idle_unref (ModuleInfo *mod);
static ModuleInfo * module_find_by_path (const gchar *fullpath);
#ifdef DUMP_DB
......@@ -722,9 +723,17 @@ mod_unload (ModuleInfo *mod,
* callback is called before the unload function returns). */
gimp_module_ref (mod);
mod->unload (mod->info->shutdown_data, mod_unload_completed_callback, mod);
gimp_module_unref (mod);
gtk_idle_add ((GtkFunction) mod_idle_unref, (gpointer) mod);
}
static gboolean
mod_idle_unref (ModuleInfo *mod)
{
gimp_module_unref (mod);
return FALSE;
}
#ifdef DUMP_DB
static void
......
......@@ -163,6 +163,7 @@ static void mod_load (ModuleInfo *mod,
gboolean verbose);
static void mod_unload (ModuleInfo *mod,
gboolean verbose);
static gboolean mod_idle_unref (ModuleInfo *mod);
static ModuleInfo * module_find_by_path (const gchar *fullpath);
#ifdef DUMP_DB
......@@ -722,9 +723,17 @@ mod_unload (ModuleInfo *mod,
* callback is called before the unload function returns). */
gimp_module_ref (mod);
mod->unload (mod->info->shutdown_data, mod_unload_completed_callback, mod);
gimp_module_unref (mod);
gtk_idle_add ((GtkFunction) mod_idle_unref, (gpointer) mod);
}
static gboolean
mod_idle_unref (ModuleInfo *mod)
{
gimp_module_unref (mod);
return FALSE;
}
#ifdef DUMP_DB
static 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