diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-04-11 14:52:57 +0100 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2014-04-14 14:30:27 -0400 |
commit | 364442c90db8bdd0da8f0760b8eb5bc87f5a785e (patch) | |
tree | af22e529a3ae21adf631dad178dc5a6801314315 | |
parent | d5b3ba24226f81c11e37959d005f4f6a3e25c519 (diff) |
TpBaseConnection: replace copy/free with g_dbus_method_invocation_take_error()
The instance in ensure_handle_cb() is not obviously correct, but
in fact @error is not used after this point, so it doesn't need setting
to NULL.
-rw-r--r-- | telepathy-glib/base-connection.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c index 840491e1e..45631fe9d 100644 --- a/telepathy-glib/base-connection.c +++ b/telepathy-glib/base-connection.c @@ -266,8 +266,7 @@ static guint signals[N_SIGNALS] = {0}; \ if (!tp_base_connection_check_connected (c_, &e_)) \ { \ - g_dbus_method_invocation_return_gerror ((context), e_); \ - g_error_free (e_); \ + g_dbus_method_invocation_take_error ((context), e_); \ return TRUE; \ } \ } G_STMT_END @@ -1515,8 +1514,7 @@ tp_base_connection_connect (_TpGDBusConnection *skeleton, TP_CONNECTION_STATUS_DISCONNECTED, conn_status_reason_from_g_error (error)); } - g_dbus_method_invocation_return_gerror (context, error); - g_error_free (error); + g_dbus_method_invocation_take_error (context, error); return TRUE; } } @@ -2446,8 +2444,7 @@ conn_requests_requestotron_validate_handle (TpBaseConnection *self, */ error->domain = TP_ERROR; error->code = TP_ERROR_INVALID_HANDLE; - g_dbus_method_invocation_return_gerror (context, error); - g_error_free (error); + g_dbus_method_invocation_take_error (context, error); return; } @@ -2469,8 +2466,7 @@ conn_requests_requestotron_validate_handle (TpBaseConnection *self, { error->domain = TP_ERROR; error->code = TP_ERROR_INVALID_HANDLE; - g_dbus_method_invocation_return_gerror (context, error); - g_error_free (error); + g_dbus_method_invocation_take_error (context, error); return; } @@ -3014,8 +3010,7 @@ ensure_handle_cb (GObject *source, if (handle == 0) { - g_dbus_method_invocation_return_gerror (data->context, error); - g_clear_error (&error); + g_dbus_method_invocation_take_error (data->context, error); goto out; } |