aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-08-03 15:28:49 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-08-03 15:39:49 +0800
commit7c54415fc4b9d9751ce2bcadcbd5e53d511ab42c (patch)
tree113ea98bd2143a5834dfd8333524106e39eba585 /libempathy
parent144d0a506e65e57b9a8486af3834067209e5be05 (diff)
downloadgsoc2013-empathy-7c54415fc4b9d9751ce2bcadcbd5e53d511ab42c.tar.gz
gsoc2013-empathy-7c54415fc4b9d9751ce2bcadcbd5e53d511ab42c.tar.zst
gsoc2013-empathy-7c54415fc4b9d9751ce2bcadcbd5e53d511ab42c.zip
goa-auth-handler: factor out auth_data_new()
We already have the _free() function and it makes easier to track the lifecycle of the struct. https://bugzilla.gnome.org/show_bug.cgi?id=680952
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-goa-auth-handler.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/libempathy/empathy-goa-auth-handler.c b/libempathy/empathy-goa-auth-handler.c
index 260ba1264..99968946d 100644
--- a/libempathy/empathy-goa-auth-handler.c
+++ b/libempathy/empathy-goa-auth-handler.c
@@ -86,6 +86,21 @@ typedef struct
gchar *access_token;
} AuthData;
+static AuthData *
+auth_data_new (EmpathyGoaAuthHandler *self,
+ TpChannel *channel,
+ TpAccount *account)
+{
+ AuthData *data;
+
+ data = g_slice_new0 (AuthData);
+ data->self = g_object_ref (self);
+ data->channel = g_object_ref (channel);
+ data->account = g_object_ref (account);
+
+ return data;
+}
+
static void
auth_data_free (AuthData *data)
{
@@ -300,10 +315,7 @@ empathy_goa_auth_handler_start (EmpathyGoaAuthHandler *self,
DEBUG ("Start Goa auth for account: %s",
tp_proxy_get_object_path (account));
- data = g_slice_new0 (AuthData);
- data->self = g_object_ref (self);
- data->channel = g_object_ref (channel);
- data->account = g_object_ref (account);
+ data = auth_data_new (self, channel, account);
if (self->priv->client == NULL)
{