[gimp] app: allow image_merge_layers_callback() to be called with NULL dialog.



commit 0359427756f9eb75c709cb5a595c66eec4e8959e
Author: Jehan <jehan girinstud io>
Date:   Mon Aug 16 22:20:07 2021 +0200

    app: allow image_merge_layers_callback() to be called with NULL dialog.
    
    This function is not only used as "response" callback to the merge
    dialog, but also called directly with a NULL dialog in
    image_merge_layers_last_vals_cmd_callback().
    
    This commit fixes:
    > (gimp-2.99:130330): Gtk-CRITICAL **: 22:17:59.774: gtk_widget_destroy: assertion 'GTK_IS_WIDGET 
(widget)' failed
    
    Reported by Massimo.

 app/actions/image-commands.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/app/actions/image-commands.c b/app/actions/image-commands.c
index 5c30bcb4cf..323cc60158 100644
--- a/app/actions/image-commands.c
+++ b/app/actions/image-commands.c
@@ -1561,5 +1561,5 @@ image_merge_layers_callback (GtkWidget     *dialog,
 
   gimp_image_flush (image);
 
-  gtk_widget_destroy (dialog);
+  g_clear_pointer (&dialog, gtk_widget_destroy);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]