diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-05-03 18:19:44 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-05-17 14:54:14 +0100 |
commit | 17d5dcf86c766075400aff5d2aa3fe8e599fb715 (patch) | |
tree | ffe8d4d20a568a24da827cc5f5580fdfea6e3105 /dbus/dbus-gobject.c | |
parent | 7f041871c3e5d023ee9cb77609bf0b69ebdbde34 (diff) |
fd.o #32087: emit signals on the appropriate connections
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32087
Diffstat (limited to 'dbus/dbus-gobject.c')
-rw-r--r-- | dbus/dbus-gobject.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c index fc8f7ed..74bc204 100644 --- a/dbus/dbus-gobject.c +++ b/dbus/dbus-gobject.c @@ -2065,8 +2065,7 @@ typedef struct { } DBusGSignalClosure; static GClosure * -dbus_g_signal_closure_new (DBusGConnection *connection, - GObject *object, +dbus_g_signal_closure_new (GObject *object, const char *signame, const char *sigiface) { @@ -2074,7 +2073,6 @@ dbus_g_signal_closure_new (DBusGConnection *connection, closure = (DBusGSignalClosure*) g_closure_new_simple (sizeof (DBusGSignalClosure), NULL); - closure->connection = dbus_g_connection_ref (connection); closure->object = object; closure->signame = signame; closure->sigiface = sigiface; @@ -2082,15 +2080,6 @@ dbus_g_signal_closure_new (DBusGConnection *connection, } static void -dbus_g_signal_closure_finalize (gpointer data, - GClosure *closure) -{ - DBusGSignalClosure *sigclosure = (DBusGSignalClosure *) closure; - - dbus_g_connection_unref (sigclosure->connection); -} - -static void emit_signal_for_registration (ObjectRegistration *o, DBusGSignalClosure *sigclosure, GValue *retval, @@ -2123,7 +2112,7 @@ emit_signal_for_registration (ObjectRegistration *o, goto out; } } - dbus_connection_send (DBUS_CONNECTION_FROM_G_CONNECTION (sigclosure->connection), + dbus_connection_send (DBUS_CONNECTION_FROM_G_CONNECTION (o->connection), signal, NULL); out: dbus_message_unref (signal); @@ -2155,7 +2144,7 @@ signal_emitter_marshaller (GClosure *closure, } static void -export_signals (DBusGConnection *connection, const GList *info_list, GObject *object) +export_signals (const GList *info_list, GObject *object) { GType gtype; const char *sigdata; @@ -2201,7 +2190,7 @@ export_signals (DBusGConnection *connection, const GList *info_list, GObject *ob continue; /* FIXME: these could be listed as methods ? */ } - closure = dbus_g_signal_closure_new (connection, object, signame, (char*) iface); + closure = dbus_g_signal_closure_new (object, signame, (char*) iface); g_closure_set_marshal (closure, signal_emitter_marshaller); g_signal_connect_closure_by_id (object, @@ -2210,8 +2199,6 @@ export_signals (DBusGConnection *connection, const GList *info_list, GObject *ob closure, FALSE); - g_closure_add_finalize_notifier (closure, NULL, - dbus_g_signal_closure_finalize); g_free (s); } } @@ -2602,7 +2589,7 @@ dbus_g_connection_register_g_object (DBusGConnection *connection, * on the first registration, because inside the signal marshaller * we emit a signal for each registration. */ - export_signals (connection, info_list, object); + export_signals (info_list, object); g_list_free (info_list); } |