[Pkg-telepathy-commits] [telepathy-glib-1] 167/212: TpBaseConnection: replace copy/free with g_dbus_method_invocation_take_error()

Simon McVittie smcv at debian.org
Wed May 14 12:09:11 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-glib-1.

commit 8f48cdd313c75d0c02f4a90ee1a99e02eab8efa5
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Fri Apr 11 14:52:57 2014 +0100

    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.
    
    Reviewed-by: Xavier Claessens <xavier.claessens at collabora.com>
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
---
 telepathy-glib/base-connection.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index 840491e..45631fe 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;
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-glib-1.git



More information about the Pkg-telepathy-commits mailing list