[gnome-builder] Revert "egg-signal-group: connect_object() handles dispose case, so we can ignore"



commit c9a674bc56672d0a93e7a7ec8b1f49f70f8b8823
Author: Garrett Regier <garrettregier gmail com>
Date:   Wed May 13 16:44:43 2015 -0700

    Revert "egg-signal-group: connect_object() handles dispose case, so we can ignore"
    
    This is does not do what it was supposed to do and
    instead it causes signal handlers to be left connected
    when freeing the EggSignalGroup. This will cause problems
    if the target object is not freed before any signals
    are emitted.
    
    This reverts commit 24d506ef5a879889b267664e9512c90121acc1d2.

 contrib/egg/egg-signal-group.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)
---
diff --git a/contrib/egg/egg-signal-group.c b/contrib/egg/egg-signal-group.c
index e4ddf7a..81fb172 100644
--- a/contrib/egg/egg-signal-group.c
+++ b/contrib/egg/egg-signal-group.c
@@ -55,7 +55,6 @@ struct _EggSignalGroup
   GPtrArray *handlers;
   GType      target_type;
   gsize      block_count;
-  guint      disposing;
 };
 
 struct _EggSignalGroupClass
@@ -237,12 +236,7 @@ egg_signal_group_unbind (EggSignalGroup *self)
       handler_id = handler->handler_id;
       handler->handler_id = 0;
 
-      /*
-       * If we are disposing, g_signal_connect_object() is already taking
-       * care of the disconnect for us. So ignore that case.
-       */
-      if (self->disposing == 0)
-        g_signal_handler_disconnect (target, handler_id);
+      g_signal_handler_disconnect (target, handler_id);
     }
 
   g_signal_emit (self, gSignals [UNBIND], 0);
@@ -425,14 +419,10 @@ egg_signal_group_dispose (GObject *object)
 {
   EggSignalGroup *self = (EggSignalGroup *)object;
 
-  self->disposing++;
-
   egg_signal_group_unbind (self);
   g_clear_pointer (&self->handlers, g_ptr_array_unref);
 
   G_OBJECT_CLASS (egg_signal_group_parent_class)->dispose (object);
-
-  self->disposing--;
 }
 
 static void


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