diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2007-09-29 21:31:57 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2007-09-29 21:31:57 +0800 |
commit | 4b3253600828b21e708eb05a3ae68427b199276e (patch) | |
tree | 983810bb6170a64ed38726985dab16897c4611f7 /libempathy/empathy-tp-group.c | |
parent | 925d8ff26c23f281527ae881106967b55826baac (diff) | |
download | gsoc2013-empathy-4b3253600828b21e708eb05a3ae68427b199276e.tar gsoc2013-empathy-4b3253600828b21e708eb05a3ae68427b199276e.tar.gz gsoc2013-empathy-4b3253600828b21e708eb05a3ae68427b199276e.tar.bz2 gsoc2013-empathy-4b3253600828b21e708eb05a3ae68427b199276e.tar.lz gsoc2013-empathy-4b3253600828b21e708eb05a3ae68427b199276e.tar.xz gsoc2013-empathy-4b3253600828b21e708eb05a3ae68427b199276e.tar.zst gsoc2013-empathy-4b3253600828b21e708eb05a3ae68427b199276e.zip |
ref group when async calls are in flight to avoid destroying the object
2007-09-29 Xavier Claessens <xclaesse@gmail.com>
* libempathy/empathy-tp-group.c: ref group when async calls are in
flight to avoid destroying the object before receiving the reply.
* libempathy/empathy-utils.c: Unref the group to not leak it.
svn path=/trunk/; revision=341
Diffstat (limited to 'libempathy/empathy-tp-group.c')
-rw-r--r-- | libempathy/empathy-tp-group.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libempathy/empathy-tp-group.c b/libempathy/empathy-tp-group.c index dbc2d228e..f6f8004cc 100644 --- a/libempathy/empathy-tp-group.c +++ b/libempathy/empathy-tp-group.c @@ -358,6 +358,7 @@ tp_group_get_members_cb (DBusGProxy *proxy, if (error) { empathy_debug (DEBUG_DOMAIN, "Failed to get members: %s", error->message); + g_object_unref (group); return; } @@ -372,6 +373,7 @@ tp_group_get_members_cb (DBusGProxy *proxy, group); g_array_free (handles, TRUE); + g_object_unref (group); } static void @@ -388,6 +390,7 @@ tp_group_get_local_pending_cb (DBusGProxy *proxy, if (error) { empathy_debug (DEBUG_DOMAIN, "Failed to get local pendings: %s", error->message); + g_object_unref (group); return; } @@ -420,6 +423,7 @@ tp_group_get_local_pending_cb (DBusGProxy *proxy, } g_ptr_array_free (array, TRUE); g_array_free (handles, TRUE); + g_object_unref (group); } static void @@ -434,6 +438,7 @@ tp_group_get_remote_pending_cb (DBusGProxy *proxy, if (error) { empathy_debug (DEBUG_DOMAIN, "Failed to get remote pendings: %s", error->message); + g_object_unref (group); return; } @@ -448,6 +453,7 @@ tp_group_get_remote_pending_cb (DBusGProxy *proxy, group); g_array_free (handles, TRUE); + g_object_unref (group); } static void @@ -455,6 +461,8 @@ tp_group_finalize (GObject *object) { EmpathyTpGroupPriv *priv = GET_PRIV (object); + empathy_debug (DEBUG_DOMAIN, "finalize: %p"); + tp_group_disconnect (EMPATHY_TP_GROUP (object)); if (priv->tp_chan) { @@ -590,13 +598,13 @@ empathy_tp_group_new (McAccount *account, tp_chan_iface_group_get_members_async (priv->group_iface, tp_group_get_members_cb, - group); + g_object_ref (group)); tp_chan_iface_group_get_local_pending_members_with_info_async (priv->group_iface, tp_group_get_local_pending_cb, - group); + g_object_ref (group)); tp_chan_iface_group_get_remote_pending_members_async (priv->group_iface, tp_group_get_remote_pending_cb, - group); + g_object_ref (group)); return group; } |