[gimp] app: fix warning when a gegl op's aux input combo box gets destroyed



commit 28c9470d5f214d11a4918b411dd24fb7aec49bef
Author: Michael Natterer <mitch gimp org>
Date:   Sun Aug 25 22:41:43 2013 +0200

    app: fix warning when a gegl op's aux input combo box gets destroyed
    
    gimp_operation_tool_aux_selected() is called with a NULL drawable
    when the combo is destroyed, but at that time the GeglNode we set
    the buffer on is already gone. Instead of adding evil if()s,
    connect_object() the combo's "select-item" signal to the node
    instead of the tool, so it gets disconnected automatically.

 app/tools/gimpoperationtool.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/app/tools/gimpoperationtool.c b/app/tools/gimpoperationtool.c
index fb4603b..167e664 100644
--- a/app/tools/gimpoperationtool.c
+++ b/app/tools/gimpoperationtool.c
@@ -467,14 +467,14 @@ static gboolean
 gimp_operation_tool_aux_selected (GimpContainerView  *view,
                                   GimpViewable       *viewable,
                                   gpointer            insert_data,
-                                  GimpOperationTool  *tool)
+                                  GeglNode           *aux_input)
 {
   GeglBuffer *buffer = NULL;
 
   if (viewable)
     buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (viewable));
 
-  gegl_node_set (tool->aux_input,
+  gegl_node_set (aux_input,
                  "buffer", buffer,
                  NULL);
 
@@ -571,7 +571,7 @@ gimp_operation_tool_set_operation (GimpOperationTool *tool,
 
       g_signal_connect_object (tool->aux_input_combo, "select-item",
                                G_CALLBACK (gimp_operation_tool_aux_selected),
-                               tool, 0);
+                               tool->aux_input, 0);
 
       channel = gimp_image_get_active_channel (image);
 


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