diff options
author | Colin Walters <walters@verbum.org> | 2012-06-21 12:12:53 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-06-21 12:12:53 -0400 |
commit | 1625cbcafb489e9c89caa3a8733a6465a53f1a2d (patch) | |
tree | b5dc7310039c0a0320dc7ac7d9861764678ca589 | |
parent | e8401842567b3bae3c6a96476f9e7b2e815acb31 (diff) | |
download | glib-1625cbcafb489e9c89caa3a8733a6465a53f1a2d.tar.gz |
gsignal: Properly handle NULL nodes
-rw-r--r-- | gobject/gsignal.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gobject/gsignal.c b/gobject/gsignal.c index 7c90a7a2e..691397993 100644 --- a/gobject/gsignal.c +++ b/gobject/gsignal.c @@ -1017,12 +1017,16 @@ g_signal_remove_emission_hook (guint signal_id, SIGNAL_LOCK (); node = LOOKUP_SIGNAL_NODE (signal_id); if (!node || node->destroyed) - g_warning ("%s: invalid signal id `%u'", G_STRLOC, signal_id); + { + g_warning ("%s: invalid signal id `%u'", G_STRLOC, signal_id); + goto out; + } else if (!node->emission_hooks || !g_hook_destroy (node->emission_hooks, hook_id)) g_warning ("%s: signal \"%s\" had no hook (%lu) to remove", G_STRLOC, node->name, hook_id); node->single_va_closure_is_valid = FALSE; + out: SIGNAL_UNLOCK (); } @@ -1775,9 +1779,9 @@ g_signal_set_va_marshaller (guint signal_id, if (cc->closure->marshal == node->c_marshaller) _g_closure_set_va_marshal (cc->closure, va_marshaller); } - } - node->single_va_closure_is_valid = FALSE; + node->single_va_closure_is_valid = FALSE; + } SIGNAL_UNLOCK (); } |