summaryrefslogtreecommitdiff
path: root/telepathy-logger/observer.c
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2010-02-11 16:42:10 +1100
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2010-02-11 16:45:00 +1100
commitd135413c2ab965cb76daacf2e5e41571e18bd655 (patch)
tree3253a0456bb87e4f2d54052498a3d450c16af268 /telepathy-logger/observer.c
parent8743d2a7cc3fa81f498e8052f899893bc24080c7 (diff)
downloadtelepathy-logger-d135413c2ab965cb76daacf2e5e41571e18bd655.tar.gz
observer: Always return from ObserveChannels, otherwise dispatching jams up
Diffstat (limited to 'telepathy-logger/observer.c')
-rw-r--r--telepathy-logger/observer.c41
1 files changed, 27 insertions, 14 deletions
diff --git a/telepathy-logger/observer.c b/telepathy-logger/observer.c
index b321538..42b8368 100644
--- a/telepathy-logger/observer.c
+++ b/telepathy-logger/observer.c
@@ -137,9 +137,9 @@ tpl_observer_observe_channels (TpSvcClientObserver *self,
GHashTable *observer_info,
DBusGMethodInvocation *dbus_context)
{
- TpAccount *tp_acc;
- TpConnection *tp_conn;
- TpDBusDaemon *tp_bus_daemon;
+ TpAccount *tp_acc = NULL;
+ TpConnection *tp_conn = NULL;
+ TpDBusDaemon *tp_bus_daemon = NULL;
TplChannelFactory chan_factory;
TplConf *conf;
GError *error = NULL;
@@ -160,14 +160,16 @@ tpl_observer_observe_channels (TpSvcClientObserver *self,
DEBUG ("%s", error->message);
else
DEBUG ("Logging is globally disabled. Skipping channel logging.");
- return;
+
+ goto error;
}
if (tpl_conf_is_account_ignored (conf, account, &error))
{
DEBUG ("Logging is disabled for account %s. "
"Channel associated to this account. "
"Skipping this channel logging.", account);
- return;
+
+ goto error;
}
/* Instantiating objects to pass to - or needed by them - the Tpl Channel Factory in order to
@@ -176,27 +178,24 @@ tpl_observer_observe_channels (TpSvcClientObserver *self,
if (tp_bus_daemon == NULL)
{
DEBUG ("%s", error->message);
- g_error_free (error);
- return;
+
+ goto error;
}
tp_acc = tp_account_new (tp_bus_daemon, account, &error);
if (tp_acc == NULL)
{
DEBUG ("%s", error->message);
- g_error_free (error);
- g_object_unref (tp_bus_daemon);
- return;
+
+ goto error;
}
tp_conn = tp_connection_new (tp_bus_daemon, NULL, connection, &error);
if (tp_conn == NULL)
{
DEBUG ("%s", error->message);
- g_error_free (error);
- g_object_unref (tp_bus_daemon);
- g_object_unref (tp_acc);
- return;
+
+ goto error;
}
/* Parallelize TplChannel preparations, when the last one will be ready, the
@@ -236,6 +235,20 @@ tpl_observer_observe_channels (TpSvcClientObserver *self,
g_object_unref (tp_acc);
g_object_unref (tp_conn);
g_object_unref (tp_bus_daemon);
+
+ return;
+
+error:
+ if (tp_acc != NULL)
+ g_object_unref (tp_acc);
+ if (tp_conn != NULL)
+ g_object_unref (tp_conn);
+ if (tp_bus_daemon != NULL)
+ g_object_unref (tp_bus_daemon);
+
+ g_clear_error (&error);
+
+ tp_svc_client_observer_return_from_observe_channels (dbus_context);
}