[gnome-builder] egg-signal-group: don't unbind from freed targets



commit f6b132576e889c72966f804881052dbc9eb3a679
Author: Carlos Soriano <csoriano gnome org>
Date:   Tue May 12 11:23:05 2015 +0200

    egg-signal-group: don't unbind from freed targets
    
    If the target is freed, we can't disconnect signals from it,
    and since the target is gone, no signal will be emitted anyway.

 contrib/egg/egg-signal-group.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/contrib/egg/egg-signal-group.c b/contrib/egg/egg-signal-group.c
index dc70e8a..268805e 100644
--- a/contrib/egg/egg-signal-group.c
+++ b/contrib/egg/egg-signal-group.c
@@ -110,6 +110,8 @@ egg_signal_group__target_weak_notify (gpointer  data,
       handler->handler_id = 0;
     }
 
+  self->target = NULL;
+
   g_signal_emit (self, gSignals [UNBIND], 0);
   g_object_notify_by_pspec (G_OBJECT (self), gParamSpecs [PROP_TARGET]);
 }
@@ -178,6 +180,8 @@ egg_signal_group_unbind (EggSignalGroup *self)
 
   g_return_if_fail (EGG_IS_SIGNAL_GROUP (self));
 
+  /* Do nothing if the target was already freed, we can't disconnect from a freed target,
+   * and since the target is gone, no signal will be emitted. */
   if (self->target == NULL)
     return;
 


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