+ HandlerList* hlist = handler_list_lookup (node->signal_id, instance);
+ Handler *l;
+ GClosure *closure = NULL;
+ gboolean fastpath = TRUE;
+ GSignalFlags run_type = G_SIGNAL_RUN_FIRST;
+
+ if (node->single_va_closure != SINGLE_VA_CLOSURE_EMPTY_MAGIC &&
+ !_g_closure_is_void (node->single_va_closure, instance))
+ {
+ if (_g_closure_supports_invoke_va (node->single_va_closure))
+ {
+ closure = node->single_va_closure;
+ if (node->single_va_closure_is_after)
+ run_type = G_SIGNAL_RUN_LAST;
+ else
+ run_type = G_SIGNAL_RUN_FIRST;
+ }
+ else
+ fastpath = FALSE;
+ }
+
+ for (l = hlist ? hlist->handlers : NULL; fastpath && l != NULL; l = l->next)
+ {
+ if (!l->block_count &&
+ (!l->detail || l->detail == detail))
+ {
+ if (closure != NULL || !_g_closure_supports_invoke_va (l->closure))
+ {
+ fastpath = FALSE;
+ break;
+ }
+ else
+ {
+ closure = l->closure;
+ if (l->after)
+ run_type = G_SIGNAL_RUN_LAST;
+ else
+ run_type = G_SIGNAL_RUN_FIRST;
+ }
+ }
+ }
+
+ if (fastpath && closure == NULL && node->return_type == G_TYPE_NONE)
+ {
+ SIGNAL_UNLOCK ();
+ return;
+ }
+
+ if (fastpath)
+ {
+ SignalAccumulator *accumulator;
+ Emission emission;
+ GValue *return_accu, accu = G_VALUE_INIT;
+ guint signal_id;
+ GValue emission_return = G_VALUE_INIT;
+ GType rtype = node->return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE;
+ gboolean static_scope = node->return_type & G_SIGNAL_TYPE_STATIC_SCOPE;
+
+ signal_id = node->signal_id;
+ accumulator = node->accumulator;
+ if (rtype == G_TYPE_NONE)
+ return_accu = NULL;
+ else if (accumulator)
+ return_accu = &accu;
+ else
+ return_accu = &emission_return;
+
+ emission.instance = instance;
+ emission.ihint.signal_id = node->signal_id;
+ emission.ihint.detail = detail;
+ emission.ihint.run_type = run_type;
+ emission.state = EMISSION_RUN;
+ emission.chain_type = G_TYPE_FROM_INSTANCE (instance);
+ emission_push (&g_recursive_emissions, &emission);
+
+ SIGNAL_UNLOCK ();
+
+ TRACE(GOBJECT_SIGNAL_EMIT(signal_id, detail, instance, G_TYPE_FROM_INSTANCE (instance)));
+
+ if (rtype != G_TYPE_NONE)
+ g_value_init (&emission_return, rtype);
+
+ if (accumulator)
+ g_value_init (&accu, rtype);
+
+ if (closure != NULL)
+ {
+ g_object_ref (instance);
+ _g_closure_invoke_va (closure,
+ return_accu,
+ instance,
+ var_args,
+ node->n_params,
+ node->param_types);
+ accumulate (&emission.ihint, &emission_return, &accu, accumulator);
+ g_object_unref (instance);
+ }
+
+ SIGNAL_LOCK ();
+
+ emission.chain_type = G_TYPE_NONE;
+ emission_pop (&g_recursive_emissions, &emission);
+
+ SIGNAL_UNLOCK ();
+
+ if (accumulator)
+ g_value_unset (&accu);
+
+ if (rtype != G_TYPE_NONE)
+ {
+ gchar *error = NULL;
+ for (i = 0; i < node->n_params; i++)
+ {
+ GType ptype = node->param_types[i] & ~G_SIGNAL_TYPE_STATIC_SCOPE;
+ G_VALUE_COLLECT_SKIP (ptype, var_args);
+ }
+
+ G_VALUE_LCOPY (&emission_return,
+ var_args,
+ static_scope ? G_VALUE_NOCOPY_CONTENTS : 0,
+ &error);
+ if (!error)
+ g_value_unset (&emission_return);
+ else
+ {
+ g_warning ("%s: %s", G_STRLOC, error);
+ g_free (error);
+ /* we purposely leak the value here, it might not be
+ * in a sane state if an error condition occurred
+ */
+ }
+ }
+
+ TRACE(GOBJECT_SIGNAL_EMIT_END(signal_id, detail, instance, G_TYPE_FROM_INSTANCE (instance)));
+
+ return;
+ }