diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-04-11 14:54:07 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-04-11 14:54:07 +0100 |
commit | 070f68158f990ae913d7ee158779a5bec224b418 (patch) | |
tree | 96a0fca8f5e4f48ce209fa415260065992494d38 | |
parent | 95bf9fcd8b56bd30e86c8485983d7e76c77f32da (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; } |