From e5528e6cd8c422586339bdebb933275a13fc66b4 Mon Sep 17 00:00:00 2001 From: BST 1999 Andy Thomas Date: Thu, 28 Oct 1999 22:47:56 +0000 Subject: [PATCH] app/gimpimage.c Thu Oct 28 23:22:34 BST 1999 Andy Thomas * app/gimpimage.c Fixed memory leak with image is deleted. * plug-ins/common/jpeg.c Fixed the way the plugin added layers. Preview stuff does not now get corrupted. --- ChangeLog | 11 +++++++++++ app/core/gimpimage-guides.c | 3 +++ app/core/gimpimage-merge.c | 3 +++ app/core/gimpimage-projection.c | 3 +++ app/core/gimpimage-resize.c | 3 +++ app/core/gimpimage-scale.c | 3 +++ app/core/gimpimage.c | 3 +++ app/core/gimpprojection-construct.c | 3 +++ app/gimpimage.c | 3 +++ plug-ins/common/jpeg.c | 4 ++-- plug-ins/jpeg/jpeg-load.c | 4 ++-- plug-ins/jpeg/jpeg-load.h | 4 ++-- plug-ins/jpeg/jpeg-save.c | 4 ++-- plug-ins/jpeg/jpeg-save.h | 4 ++-- plug-ins/jpeg/jpeg.c | 4 ++-- plug-ins/jpeg/jpeg.h | 4 ++-- 16 files changed, 49 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index b7a4bbb312..327dddaf50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Thu Oct 28 23:22:34 BST 1999 Andy Thomas + + * app/gimpimage.c + + Fixed memory leak with image is deleted. + + * plug-ins/common/jpeg.c + + Fixed the way the plugin added layers. Preview stuff does not now + get corrupted. + 1999-10-28 Michael Natterer * app/Makefile.am diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index 063cf56b23..173f42a164 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -657,6 +657,9 @@ gimp_image_destroy (GtkObject *object) gimp_image_free_channels (gimage); channel_delete (gimage->selection_mask); + if (gimage->comp_preview) + temp_buf_free (gimage->comp_preview); + if (gimage->parasites) gtk_object_unref (GTK_OBJECT (gimage->parasites)); } diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index 063cf56b23..173f42a164 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -657,6 +657,9 @@ gimp_image_destroy (GtkObject *object) gimp_image_free_channels (gimage); channel_delete (gimage->selection_mask); + if (gimage->comp_preview) + temp_buf_free (gimage->comp_preview); + if (gimage->parasites) gtk_object_unref (GTK_OBJECT (gimage->parasites)); } diff --git a/app/core/gimpimage-projection.c b/app/core/gimpimage-projection.c index 063cf56b23..173f42a164 100644 --- a/app/core/gimpimage-projection.c +++ b/app/core/gimpimage-projection.c @@ -657,6 +657,9 @@ gimp_image_destroy (GtkObject *object) gimp_image_free_channels (gimage); channel_delete (gimage->selection_mask); + if (gimage->comp_preview) + temp_buf_free (gimage->comp_preview); + if (gimage->parasites) gtk_object_unref (GTK_OBJECT (gimage->parasites)); } diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c index 063cf56b23..173f42a164 100644 --- a/app/core/gimpimage-resize.c +++ b/app/core/gimpimage-resize.c @@ -657,6 +657,9 @@ gimp_image_destroy (GtkObject *object) gimp_image_free_channels (gimage); channel_delete (gimage->selection_mask); + if (gimage->comp_preview) + temp_buf_free (gimage->comp_preview); + if (gimage->parasites) gtk_object_unref (GTK_OBJECT (gimage->parasites)); } diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index 063cf56b23..173f42a164 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -657,6 +657,9 @@ gimp_image_destroy (GtkObject *object) gimp_image_free_channels (gimage); channel_delete (gimage->selection_mask); + if (gimage->comp_preview) + temp_buf_free (gimage->comp_preview); + if (gimage->parasites) gtk_object_unref (GTK_OBJECT (gimage->parasites)); } diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index 063cf56b23..173f42a164 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -657,6 +657,9 @@ gimp_image_destroy (GtkObject *object) gimp_image_free_channels (gimage); channel_delete (gimage->selection_mask); + if (gimage->comp_preview) + temp_buf_free (gimage->comp_preview); + if (gimage->parasites) gtk_object_unref (GTK_OBJECT (gimage->parasites)); } diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index 063cf56b23..173f42a164 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -657,6 +657,9 @@ gimp_image_destroy (GtkObject *object) gimp_image_free_channels (gimage); channel_delete (gimage->selection_mask); + if (gimage->comp_preview) + temp_buf_free (gimage->comp_preview); + if (gimage->parasites) gtk_object_unref (GTK_OBJECT (gimage->parasites)); } diff --git a/app/gimpimage.c b/app/gimpimage.c index 063cf56b23..173f42a164 100644 --- a/app/gimpimage.c +++ b/app/gimpimage.c @@ -657,6 +657,9 @@ gimp_image_destroy (GtkObject *object) gimp_image_free_channels (gimage); channel_delete (gimage->selection_mask); + if (gimage->comp_preview) + temp_buf_free (gimage->comp_preview); + if (gimage->parasites) gtk_object_unref (GTK_OBJECT (gimage->parasites)); } diff --git a/plug-ins/common/jpeg.c b/plug-ins/common/jpeg.c index 1b15340b43..67b33d61f5 100644 --- a/plug-ins/common/jpeg.c +++ b/plug-ins/common/jpeg.c @@ -888,8 +888,6 @@ load_image (char *filename, layer_type, 100, NORMAL_MODE); } - gimp_image_add_layer (image_ID, layer_ID, 0); - drawable_global = drawable = gimp_drawable_get (layer_ID); gimp_pixel_rgn_init (&pixel_rgn, drawable, 0, 0, drawable->width, drawable->height, TRUE, FALSE); @@ -1022,6 +1020,7 @@ load_image (char *filename, /* Tell the GIMP to display the image. */ + gimp_image_add_layer (image_ID, layer_ID, 0); gimp_drawable_flush (drawable); /* pw - Last of all, attach the parasites (couldn't do it earlier - @@ -1473,6 +1472,7 @@ make_preview () gimp_displays_flush (); gdk_flush(); } + } static void diff --git a/plug-ins/jpeg/jpeg-load.c b/plug-ins/jpeg/jpeg-load.c index 1b15340b43..67b33d61f5 100644 --- a/plug-ins/jpeg/jpeg-load.c +++ b/plug-ins/jpeg/jpeg-load.c @@ -888,8 +888,6 @@ load_image (char *filename, layer_type, 100, NORMAL_MODE); } - gimp_image_add_layer (image_ID, layer_ID, 0); - drawable_global = drawable = gimp_drawable_get (layer_ID); gimp_pixel_rgn_init (&pixel_rgn, drawable, 0, 0, drawable->width, drawable->height, TRUE, FALSE); @@ -1022,6 +1020,7 @@ load_image (char *filename, /* Tell the GIMP to display the image. */ + gimp_image_add_layer (image_ID, layer_ID, 0); gimp_drawable_flush (drawable); /* pw - Last of all, attach the parasites (couldn't do it earlier - @@ -1473,6 +1472,7 @@ make_preview () gimp_displays_flush (); gdk_flush(); } + } static void diff --git a/plug-ins/jpeg/jpeg-load.h b/plug-ins/jpeg/jpeg-load.h index 1b15340b43..67b33d61f5 100644 --- a/plug-ins/jpeg/jpeg-load.h +++ b/plug-ins/jpeg/jpeg-load.h @@ -888,8 +888,6 @@ load_image (char *filename, layer_type, 100, NORMAL_MODE); } - gimp_image_add_layer (image_ID, layer_ID, 0); - drawable_global = drawable = gimp_drawable_get (layer_ID); gimp_pixel_rgn_init (&pixel_rgn, drawable, 0, 0, drawable->width, drawable->height, TRUE, FALSE); @@ -1022,6 +1020,7 @@ load_image (char *filename, /* Tell the GIMP to display the image. */ + gimp_image_add_layer (image_ID, layer_ID, 0); gimp_drawable_flush (drawable); /* pw - Last of all, attach the parasites (couldn't do it earlier - @@ -1473,6 +1472,7 @@ make_preview () gimp_displays_flush (); gdk_flush(); } + } static void diff --git a/plug-ins/jpeg/jpeg-save.c b/plug-ins/jpeg/jpeg-save.c index 1b15340b43..67b33d61f5 100644 --- a/plug-ins/jpeg/jpeg-save.c +++ b/plug-ins/jpeg/jpeg-save.c @@ -888,8 +888,6 @@ load_image (char *filename, layer_type, 100, NORMAL_MODE); } - gimp_image_add_layer (image_ID, layer_ID, 0); - drawable_global = drawable = gimp_drawable_get (layer_ID); gimp_pixel_rgn_init (&pixel_rgn, drawable, 0, 0, drawable->width, drawable->height, TRUE, FALSE); @@ -1022,6 +1020,7 @@ load_image (char *filename, /* Tell the GIMP to display the image. */ + gimp_image_add_layer (image_ID, layer_ID, 0); gimp_drawable_flush (drawable); /* pw - Last of all, attach the parasites (couldn't do it earlier - @@ -1473,6 +1472,7 @@ make_preview () gimp_displays_flush (); gdk_flush(); } + } static void diff --git a/plug-ins/jpeg/jpeg-save.h b/plug-ins/jpeg/jpeg-save.h index 1b15340b43..67b33d61f5 100644 --- a/plug-ins/jpeg/jpeg-save.h +++ b/plug-ins/jpeg/jpeg-save.h @@ -888,8 +888,6 @@ load_image (char *filename, layer_type, 100, NORMAL_MODE); } - gimp_image_add_layer (image_ID, layer_ID, 0); - drawable_global = drawable = gimp_drawable_get (layer_ID); gimp_pixel_rgn_init (&pixel_rgn, drawable, 0, 0, drawable->width, drawable->height, TRUE, FALSE); @@ -1022,6 +1020,7 @@ load_image (char *filename, /* Tell the GIMP to display the image. */ + gimp_image_add_layer (image_ID, layer_ID, 0); gimp_drawable_flush (drawable); /* pw - Last of all, attach the parasites (couldn't do it earlier - @@ -1473,6 +1472,7 @@ make_preview () gimp_displays_flush (); gdk_flush(); } + } static void diff --git a/plug-ins/jpeg/jpeg.c b/plug-ins/jpeg/jpeg.c index 1b15340b43..67b33d61f5 100644 --- a/plug-ins/jpeg/jpeg.c +++ b/plug-ins/jpeg/jpeg.c @@ -888,8 +888,6 @@ load_image (char *filename, layer_type, 100, NORMAL_MODE); } - gimp_image_add_layer (image_ID, layer_ID, 0); - drawable_global = drawable = gimp_drawable_get (layer_ID); gimp_pixel_rgn_init (&pixel_rgn, drawable, 0, 0, drawable->width, drawable->height, TRUE, FALSE); @@ -1022,6 +1020,7 @@ load_image (char *filename, /* Tell the GIMP to display the image. */ + gimp_image_add_layer (image_ID, layer_ID, 0); gimp_drawable_flush (drawable); /* pw - Last of all, attach the parasites (couldn't do it earlier - @@ -1473,6 +1472,7 @@ make_preview () gimp_displays_flush (); gdk_flush(); } + } static void diff --git a/plug-ins/jpeg/jpeg.h b/plug-ins/jpeg/jpeg.h index 1b15340b43..67b33d61f5 100644 --- a/plug-ins/jpeg/jpeg.h +++ b/plug-ins/jpeg/jpeg.h @@ -888,8 +888,6 @@ load_image (char *filename, layer_type, 100, NORMAL_MODE); } - gimp_image_add_layer (image_ID, layer_ID, 0); - drawable_global = drawable = gimp_drawable_get (layer_ID); gimp_pixel_rgn_init (&pixel_rgn, drawable, 0, 0, drawable->width, drawable->height, TRUE, FALSE); @@ -1022,6 +1020,7 @@ load_image (char *filename, /* Tell the GIMP to display the image. */ + gimp_image_add_layer (image_ID, layer_ID, 0); gimp_drawable_flush (drawable); /* pw - Last of all, attach the parasites (couldn't do it earlier - @@ -1473,6 +1472,7 @@ make_preview () gimp_displays_flush (); gdk_flush(); } + } static void