Currently GIMP crashes in some situations (for example, when scaling an
image) if it's compiled with G_DISABLE_ASSERT macro defined. Attached patch
fixes this. Is it ok to commit? (the patch is against gimp-1-2 branch)


Zbigniew
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gimp/ChangeLog,v
retrieving revision 1.3145.2.43
diff -u -r1.3145.2.43 ChangeLog
--- ChangeLog   2001/03/01 21:05:36     1.3145.2.43
+++ ChangeLog   2001/03/03 17:25:50
@@ -1,3 +1,11 @@
+2001-03-03  Zbigniew Chyla  <[EMAIL PROTECTED]>
+
+       * app/commands.c (image_scale_callback),
+       libgimp/gimpchainbutton.c (gimp_chain_button_destroy),
+       libgimp/gimpcolorbutton.c (gimp_color_button_destroy):
+       Move variable assignments out of assertions to allow compilation
+       with "G_DISABLE_ASSERT" defined.
+
 2001-03-01  Daniel Egger  <[EMAIL PROTECTED]>
 
        * ChangeLog:
Index: app/commands.c
===================================================================
RCS file: /cvs/gnome/gimp/app/commands.c,v
retrieving revision 1.107
diff -u -r1.107 commands.c
--- app/commands.c      2000/12/24 20:27:03     1.107
+++ app/commands.c      2001/03/03 17:25:50
@@ -1345,9 +1345,9 @@
 image_scale_callback (GtkWidget *widget,
                      gpointer   client_data)
 {
-  ImageResize *image_scale = NULL;
+  ImageResize *image_scale = (ImageResize *) client_data;
 
-  g_assert ((image_scale = (ImageResize *) client_data) != NULL);
+  g_assert (image_scale != NULL);
   g_assert (image_scale->gimage != NULL);
 
   gtk_widget_set_sensitive (image_scale->resize->resize_shell, FALSE);
Index: libgimp/gimpchainbutton.c
===================================================================
RCS file: /cvs/gnome/gimp/libgimp/Attic/gimpchainbutton.c,v
retrieving revision 1.17
diff -u -r1.17 gimpchainbutton.c
--- libgimp/gimpchainbutton.c   2000/08/27 22:41:52     1.17
+++ libgimp/gimpchainbutton.c   2001/03/03 17:25:51
@@ -73,9 +73,9 @@
 static void
 gimp_chain_button_destroy (GtkObject *object)
 {
-  GimpChainButton *gcb;
+  GimpChainButton *gcb = GIMP_CHAIN_BUTTON (object);
 
-  g_return_if_fail (gcb = GIMP_CHAIN_BUTTON (object));
+  g_return_if_fail (gcb != NULL);
 
   if (gcb->broken)
     gdk_pixmap_unref (gcb->broken);
Index: libgimp/gimpcolorbutton.c
===================================================================
RCS file: /cvs/gnome/gimp/libgimp/Attic/gimpcolorbutton.c,v
retrieving revision 1.17
diff -u -r1.17 gimpcolorbutton.c
--- libgimp/gimpcolorbutton.c   2000/11/18 00:25:39     1.17
+++ libgimp/gimpcolorbutton.c   2001/03/03 17:25:51
@@ -138,9 +138,9 @@
 static void
 gimp_color_button_destroy (GtkObject *object)
 {
-  GimpColorButton *gcb;
+  GimpColorButton *gcb = GIMP_COLOR_BUTTON (object);
    
-  g_return_if_fail (gcb = GIMP_COLOR_BUTTON (object));
+  g_return_if_fail (gcb != NULL);
   
   g_free (gcb->title);
 
Index: libgimp/gimppixmap.c
===================================================================
RCS file: /cvs/gnome/gimp/libgimp/Attic/gimppixmap.c,v
retrieving revision 1.9
diff -u -r1.9 gimppixmap.c
--- libgimp/gimppixmap.c        2000/11/18 00:25:40     1.9
+++ libgimp/gimppixmap.c        2001/03/03 17:25:51
@@ -38,9 +38,9 @@
 static void
 gimp_pixmap_destroy (GtkObject *object)
 {
-  GimpPixmap *pixmap;
+  GimpPixmap *pixmap = GIMP_PIXMAP (object);
 
-  g_return_if_fail (pixmap = GIMP_PIXMAP (object));
+  g_return_if_fail (pixmap != NULL);
 
   if (GTK_OBJECT_CLASS (parent_class)->destroy)
     GTK_OBJECT_CLASS (parent_class)->destroy (object);

Reply via email to