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

app/plug-in/plug-in-rc.c app/plug-in/plug-ins.c app/tools/tool_manager.c

2002-03-22  Sven Neumann  <sven@gimp.org>

	* app/plug-in/plug-in-rc.c
	* app/plug-in/plug-ins.c
	* app/tools/tool_manager.c
	* app/widgets/gimppreview.c
	* app/widgets/gimptoolinfopreview.c: plugged a couple of mem leaks
	found using valgrind.

	* libgimpwidgets/gimpcolorarea.c (gimp_color_area_expose): don't draw
	anything if an idle update is pending.
parent f0cf8be7
2002-03-22 Sven Neumann <sven@gimp.org>
* app/plug-in/plug-in-rc.c
* app/plug-in/plug-ins.c
* app/tools/tool_manager.c
* app/widgets/gimppreview.c
* app/widgets/gimptoolinfopreview.c: plugged a couple of mem leaks
found using valgrind.
* libgimpwidgets/gimpcolorarea.c (gimp_color_area_expose): don't draw
anything if an idle update is pending.
2002-03-22 Sven Neumann <sven@gimp.org>
 
* app/appenv.h: moved use_shm declaration here, added use_mmx.
......
......@@ -316,6 +316,7 @@ gimp_drawable_copy (GimpDrawable *drawable,
gimp_drawable_height (drawable),
new_image_type,
new_name);
g_free (new_name);
new_drawable->offset_x = drawable->offset_x;
new_drawable->offset_y = drawable->offset_y;
......
......@@ -218,7 +218,10 @@ gimp_image_duplicate (GimpImage *gimage)
/* Copy parasites */
parasites = gimage->parasites;
if (parasites)
new_gimage->parasites = gimp_parasite_list_copy (parasites);
{
g_object_unref (new_gimage->parasites);
new_gimage->parasites = gimp_parasite_list_copy (parasites);
}
/* Copy paths */
paths = gimp_image_get_paths (gimage);
......
......@@ -459,6 +459,7 @@ plug_ins_def_add (PlugInDef *plug_in_def)
}
g_free (basename2);
g_free (basename1);
return;
}
......
......@@ -174,6 +174,7 @@ plug_in_def_deserialize (GScanner *scanner)
return G_TOKEN_STRING;
plug_in_def = plug_in_def_new (name);
g_free (name);
if (!parse_int (scanner, (gint *) &plug_in_def->mtime))
{
......
......@@ -459,6 +459,7 @@ plug_ins_def_add (PlugInDef *plug_in_def)
}
g_free (basename2);
g_free (basename1);
return;
}
......
......@@ -154,15 +154,17 @@ tool_manager_exit (Gimp *gimp)
g_return_if_fail (GIMP_IS_GIMP (gimp));
tool_manager = tool_manager_get (gimp);
tool_manager_set (gimp, NULL);
g_object_unref (G_OBJECT (tool_manager->global_tool_context));
gimp_container_remove_handler (gimp->images,
tool_manager->image_dirty_handler_id);
g_free (tool_manager);
if (tool_manager->active_tool)
g_object_unref (G_OBJECT (tool_manager->active_tool));
tool_manager_set (gimp, NULL);
g_free (tool_manager);
}
GimpTool *
......
......@@ -272,8 +272,13 @@ gimp_preview_destroy (GtkObject *object)
if (preview->viewable)
gimp_preview_set_viewable (preview, NULL);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
if (preview->buffer)
{
g_free (preview->buffer);
preview->buffer = NULL;
}
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
......
......@@ -272,8 +272,13 @@ gimp_preview_destroy (GtkObject *object)
if (preview->viewable)
gimp_preview_set_viewable (preview, NULL);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
if (preview->buffer)
{
g_free (preview->buffer);
preview->buffer = NULL;
}
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
......
......@@ -193,6 +193,8 @@ gimp_tool_info_preview_render (GimpPreview *preview)
}
gimp_preview_render_and_flush (preview, render_buf, -1);
temp_buf_free (render_buf);
}
break;
......
......@@ -272,8 +272,13 @@ gimp_preview_destroy (GtkObject *object)
if (preview->viewable)
gimp_preview_set_viewable (preview, NULL);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
if (preview->buffer)
{
g_free (preview->buffer);
preview->buffer = NULL;
}
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
......
......@@ -272,8 +272,13 @@ gimp_preview_destroy (GtkObject *object)
if (preview->viewable)
gimp_preview_set_viewable (preview, NULL);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
GTK_OBJECT_CLASS (parent_class)->destroy (object);
if (preview->buffer)
{
g_free (preview->buffer);
preview->buffer = NULL;
}
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
static void
......
......@@ -219,7 +219,7 @@ gimp_color_area_expose (GtkWidget *widget,
gca = GIMP_COLOR_AREA (widget);
if (!GTK_WIDGET_DRAWABLE (widget) || !gca->buf)
if (!GTK_WIDGET_DRAWABLE (widget) || !gca->buf || gca->idle_id)
return FALSE;
buf = gca->buf + event->area.y * gca->rowstride + event->area.x * 3;
......
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