From 490da5b3b994aa7516b99b046dad24143cf99cda Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 13 Feb 2012 11:04:17 +0100 Subject: [PATCH] make sure the result object stays alive while renaming groups I started tracking this in Gabble so my unit test is living there. https://bugs.freedesktop.org/show_bug.cgi?id=45982 --- telepathy-glib/base-contact-list.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c index d10c575..5039f9b 100644 --- a/telepathy-glib/base-contact-list.c +++ b/telepathy-glib/base-contact-list.c @@ -4441,6 +4441,7 @@ emulate_rename_group_remove_cb (GObject *source, } g_simple_async_result_complete (rename_result); + g_object_unref (rename_result); } static void @@ -4457,12 +4458,15 @@ emulate_rename_group_add_cb (GObject *source, g_simple_async_result_set_from_error (rename_result, error); g_clear_error (&error); g_simple_async_result_complete (rename_result); - return; + goto out; } tp_base_contact_list_remove_group_async (self, g_simple_async_result_get_op_res_gpointer (rename_result), - emulate_rename_group_remove_cb, rename_result); + emulate_rename_group_remove_cb, g_object_ref (rename_result)); + +out: + g_object_unref (rename_result); } static void @@ -4493,7 +4497,7 @@ tp_base_contact_list_emulate_rename_group (TpBaseContactList *self, old_members = tp_base_contact_list_dup_group_members (self, old_name); tp_base_contact_list_add_to_group_async (self, new_name, old_members, - emulate_rename_group_add_cb, result); + emulate_rename_group_add_cb, g_object_ref (result)); g_object_unref (result); tp_handle_set_destroy (old_members); } -- 1.7.7.6