diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-04-11 14:52:57 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-04-11 14:52:57 +0100 |
commit | 95bf9fcd8b56bd30e86c8485983d7e76c77f32da (patch) | |
tree | 1b7cfb7e79b14af1afb2b74c95541d227a1d4b0d | |
parent | cf28b7bba203f7df6d992cd05e05084283276d36 (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; } |