From f6038c7c1a4302e298fbdadc81e5e89fc844e6b2 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 13 Feb 2012 11:04:17 +0100 Subject: 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 file changed, 7 insertions(+), 3 deletions(-) diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c index a1b4e1f3b..613960a6b 100644 --- a/telepathy-glib/base-contact-list.c +++ b/telepathy-glib/base-contact-list.c @@ -4439,6 +4439,7 @@ emulate_rename_group_remove_cb (GObject *source, } g_simple_async_result_complete (rename_result); + g_object_unref (rename_result); } static void @@ -4455,12 +4456,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 @@ -4491,7 +4495,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); } -- cgit v1.2.1