diff options
author | Kristian Rietveld <kris@imendio.com> | 2009-03-13 09:22:57 +0000 |
---|---|---|
committer | Kristian Rietveld <kristian@src.gnome.org> | 2009-03-13 09:22:57 +0000 |
commit | 622f01012030fcba31ee2a68920873ac06bb62e4 (patch) | |
tree | d357a92c03a06e0cf392c2c50ad6596cf8cdc114 | |
parent | 621ef866b14af56865eb65062c271ba3d06cfe7d (diff) |
when defaulting to the only item in the array, check if this is indeed the
2009-03-13 Kristian Rietveld <kris@imendio.com>
* gsignal.c (signal_lookup_closure): when defaulting to the only
item in the array, check if this is indeed the default closure.
(patch by Tim Janik).
svn path=/trunk/; revision=7979
-rw-r--r-- | gobject/ChangeLog | 6 | ||||
-rw-r--r-- | gobject/gsignal.c | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/gobject/ChangeLog b/gobject/ChangeLog index 9134e65f4..039211f49 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -1,3 +1,9 @@ +2009-03-13 Kristian Rietveld <kris@imendio.com> + + * gsignal.c (signal_lookup_closure): when defaulting to the only + item in the array, check if this is indeed the default closure. + (patch by Tim Janik). + 2009-03-13 Matthias Clasen <mclasen@redhat.com> * === Released 2.20.0 === diff --git a/gobject/gsignal.c b/gobject/gsignal.c index 9908e16aa..d69b880cf 100644 --- a/gobject/gsignal.c +++ b/gobject/gsignal.c @@ -1448,9 +1448,12 @@ signal_lookup_closure (SignalNode *node, ClassClosure *cc; if (node->class_closure_bsa && g_bsearch_array_get_n_nodes (node->class_closure_bsa) == 1) - cc = g_bsearch_array_get_nth (node->class_closure_bsa, &g_class_closure_bconfig, 0); - else - cc = signal_find_class_closure (node, G_TYPE_FROM_INSTANCE (instance)); + { + cc = g_bsearch_array_get_nth (node->class_closure_bsa, &g_class_closure_bconfig, 0); + if (cc && cc->instance_type == 0) /* check for default closure */ + return cc->closure; + } + cc = signal_find_class_closure (node, G_TYPE_FROM_INSTANCE (instance)); return cc ? cc->closure : NULL; } |