diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-04-11 14:54:07 +0100 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2014-04-14 14:30:27 -0400 |
commit | 95bab7fbb0eb9769f7c81daa90147d55d3ff189d (patch) | |
tree | 7ae7b1ba5977277fb49576c08e424690e24bee9f | |
parent | 364442c90db8bdd0da8f0760b8eb5bc87f5a785e (diff) |
TpBaseConnection: use g_dbus_method_invocation_return_error_literal
This avoids putting a temporary GError on the stack, which was always
slightly questionable use of the GError API.
-rw-r--r-- | telepathy-glib/base-connection.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c index 45631fe9d..f7a13e952 100644 --- a/telepathy-glib/base-connection.c +++ b/telepathy-glib/base-connection.c @@ -2286,8 +2286,8 @@ static void conn_requests_offer_request (TpBaseConnection *self, #define RETURN_INVALID_ARGUMENT(message) \ G_STMT_START { \ - GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, message }; \ - g_dbus_method_invocation_return_gerror (context, &e); \ + g_dbus_method_invocation_return_error_literal (context, TP_ERROR, \ + TP_ERROR_INVALID_ARGUMENT, message); \ return; \ } G_STMT_END @@ -2425,10 +2425,9 @@ conn_requests_requestotron_validate_handle (TpBaseConnection *self, if (handles == NULL) { - GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, - "entity type not supported by this connection manager" }; - - g_dbus_method_invocation_return_gerror (context, &e); + g_dbus_method_invocation_return_error_literal (context, + TP_ERROR, TP_ERROR_NOT_AVAILABLE, + "entity type not supported by this connection manager"); return; } |