From 2ebd2e1cd78a2bb2d45f7cff51cbb590b07b366f Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 20 Sep 2010 10:09:51 +0200 Subject: use tp_clear_object to unref the cancellable --- libempathy-gtk/empathy-contact-widget.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index 4ee188cdd..4b21f374f 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -465,8 +465,7 @@ contact_widget_details_request_cb (GObject *object, G_CALLBACK (contact_widget_details_notify_cb), information); } - g_object_unref (information->details_cancellable); - information->details_cancellable = NULL; + tp_clear_object (&information->details_cancellable); } static void -- cgit v1.2.3 From 348652d606e06f1871880d689ee60cae9ea707bc Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 20 Sep 2010 10:11:28 +0200 Subject: contact-widget: unref the cancellable once we have cancelled the operation (#629957) The comment was a lie, contact_widget_details_request_cb early returns when the operation has been cancelled so it wasn't unset. There is no point waiting any way so we can unref it right away. --- libempathy-gtk/empathy-contact-widget.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index 4b21f374f..15dda50f3 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -1176,9 +1176,8 @@ contact_widget_remove_contact (EmpathyContactWidget *information) if (information->details_cancellable != NULL) { - /* The cancellable will be unreffed and cleared in - * contact_widget_details_request_cb */ g_cancellable_cancel (information->details_cancellable); + tp_clear_object (&information->details_cancellable); } } -- cgit v1.2.3