[empathy] empathy_protocol_chooser_create_account_settings: ensure that cm is always unrefed
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] empathy_protocol_chooser_create_account_settings: ensure that cm is always unrefed
- Date: Thu, 17 Feb 2011 13:50:33 +0000 (UTC)
commit 84b316b42725de82000353a9650e9304f5d4f825
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Thu Feb 17 11:59:21 2011 +0100
empathy_protocol_chooser_create_account_settings: ensure that cm is always unrefed
libempathy-gtk/empathy-protocol-chooser.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/libempathy-gtk/empathy-protocol-chooser.c b/libempathy-gtk/empathy-protocol-chooser.c
index 689f6a2..6e6b8bb 100644
--- a/libempathy-gtk/empathy-protocol-chooser.c
+++ b/libempathy-gtk/empathy-protocol-chooser.c
@@ -561,16 +561,16 @@ empathy_protocol_chooser_set_visible (EmpathyProtocolChooser *protocol_chooser,
EmpathyAccountSettings *
empathy_protocol_chooser_create_account_settings (EmpathyProtocolChooser *self)
{
- EmpathyAccountSettings *settings;
+ EmpathyAccountSettings *settings = NULL;
gchar *str;
const gchar *display_name;
TpConnectionManager *cm;
TpConnectionManagerProtocol *proto;
- gchar *service;
+ gchar *service = NULL;
cm = empathy_protocol_chooser_dup_selected (self, &proto, &service);
if (cm == NULL || proto == NULL)
- return NULL;
+ goto out;
if (service != NULL)
display_name = empathy_service_name_to_display_name (service);
@@ -609,7 +609,8 @@ empathy_protocol_chooser_create_account_settings (EmpathyProtocolChooser *self)
"chat.facebook.com");
}
- g_object_unref (cm);
+out:
+ tp_clear_object (&cm);
g_free (service);
return settings;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]