diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-01-11 14:36:25 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-01-11 14:36:25 +0000 |
commit | 2923494215718c9c04008126494d7b7df4555461 (patch) | |
tree | e5e6815aa2339290444a37f06953b75d90591fcf /telepathy-glib/handle-repo-dynamic.c | |
parent | 90e901c8e405bd5a1477429ff9c6fb522b087c23 (diff) | |
download | telepathy-glib-2923494215718c9c04008126494d7b7df4555461.tar.gz |
handle-repo-dynamic: if the TpDBusDaemon ever goes to 0 refs, null out the pointer
20080111143625-53eee-a4d36036fd2d5b0c2d7facc4bb0d5ebc764ee3da.gz
Diffstat (limited to 'telepathy-glib/handle-repo-dynamic.c')
-rw-r--r-- | telepathy-glib/handle-repo-dynamic.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/telepathy-glib/handle-repo-dynamic.c b/telepathy-glib/handle-repo-dynamic.c index 5f2d16746..ccba31122 100644 --- a/telepathy-glib/handle-repo-dynamic.c +++ b/telepathy-glib/handle-repo-dynamic.c @@ -184,7 +184,7 @@ struct _TpDynamicHandleRepo { }; /* To listen for NameOwnerChanged. One ref per dynamic handle repo */ -static TpDBusDaemon *bus_daemon; +static gpointer bus_daemon; static TpDBusDaemon * ref_bus_daemon (void) @@ -193,7 +193,8 @@ ref_bus_daemon (void) return g_object_ref (bus_daemon); bus_daemon = tp_dbus_daemon_new (tp_get_bus ()); - return bus_daemon; + g_object_add_weak_pointer (bus_daemon, &bus_daemon); + return (TpDBusDaemon *) bus_daemon; } static void dynamic_repo_iface_init (gpointer g_iface, |