]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gdbus: Use g_dbus_method_invocation_take_error() as simplification
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 10 Nov 2021 14:35:53 +0000 (15:35 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 12 Nov 2021 14:32:53 +0000 (15:32 +0100)
38 files changed:
codegen/valagdbusservermodule.vala
tests/dbus/arrays_client.c-expected
tests/dbus/async-bus_client.c-expected
tests/dbus/async-bus_server.c-expected
tests/dbus/async-connection_client.c-expected
tests/dbus/async-connection_server.c-expected
tests/dbus/async-errors_client.c-expected
tests/dbus/async-errors_server.c-expected
tests/dbus/async-no-reply_client.c-expected
tests/dbus/async_client.c-expected
tests/dbus/basic-types_client.c-expected
tests/dbus/bug602003_client.c-expected
tests/dbus/bug735437_client.c-expected
tests/dbus/bug782719_client.c-expected
tests/dbus/bug783002_client.c-expected
tests/dbus/bug783002_server.c-expected
tests/dbus/bug792277.c-expected
tests/dbus/connection_client.c-expected
tests/dbus/connection_server.c-expected
tests/dbus/dicts_client.c-expected
tests/dbus/dicts_server.c-expected
tests/dbus/dynamic-method_server.c-expected
tests/dbus/enum-string-marshalling.c-expected
tests/dbus/errors_client.c-expected
tests/dbus/errors_server.c-expected
tests/dbus/filedescriptor-async_client.c-expected
tests/dbus/filedescriptor-async_server.c-expected
tests/dbus/filedescriptor-errors_client.c-expected
tests/dbus/filedescriptor-errors_server.c-expected
tests/dbus/filedescriptor_client.c-expected
tests/dbus/filedescriptor_server.c-expected
tests/dbus/generics_client.c-expected
tests/dbus/generics_server.c-expected
tests/dbus/no-reply_client.c-expected
tests/dbus/rawvariants_client.c-expected
tests/dbus/signals_client.c-expected
tests/dbus/signals_server.c-expected
tests/dbus/structs_client.c-expected

index e6f379c9f808f231f2dca9eb281fb09b2c8e8576..6e026b43b0225c61a888ef2c7b520949bf541dc6 100644 (file)
@@ -176,15 +176,11 @@ public class Vala.GDBusServerModule : GDBusClientModule {
 
                                        ccode.open_if (new CCodeIdentifier ("error"));
 
-                                       var return_error = new CCodeFunctionCall (new CCodeIdentifier ("g_dbus_method_invocation_return_gerror"));
+                                       var return_error = new CCodeFunctionCall (new CCodeIdentifier ("g_dbus_method_invocation_take_error"));
                                        return_error.add_argument (new CCodeIdentifier ("invocation"));
                                        return_error.add_argument (new CCodeIdentifier ("error"));
                                        ccode.add_expression (return_error);
 
-                                       var free_error = new CCodeFunctionCall (new CCodeIdentifier ("g_error_free"));
-                                       free_error.add_argument (new CCodeIdentifier ("error"));
-                                       ccode.add_expression (free_error);
-
                                        if (need_goto_label || requires_destroy (owned_type)) {
                                                ccode.add_goto ("_error");
                                                need_goto_label = true;
@@ -291,15 +287,11 @@ public class Vala.GDBusServerModule : GDBusClientModule {
                        if (m.tree_can_fail) {
                                ccode.open_if (new CCodeIdentifier ("error"));
 
-                               var return_error = new CCodeFunctionCall (new CCodeIdentifier ("g_dbus_method_invocation_return_gerror"));
+                               var return_error = new CCodeFunctionCall (new CCodeIdentifier ("g_dbus_method_invocation_take_error"));
                                return_error.add_argument (new CCodeIdentifier ("invocation"));
                                return_error.add_argument (new CCodeIdentifier ("error"));
                                ccode.add_expression (return_error);
 
-                               var free_error = new CCodeFunctionCall (new CCodeIdentifier ("g_error_free"));
-                               free_error.add_argument (new CCodeIdentifier ("error"));
-                               ccode.add_expression (free_error);
-
                                if (need_goto_label) {
                                        ccode.add_goto ("_error");
                                } else {
index 8c17358f02161d2718ea7534d7ce5d8d829a6241..3ca15671e6a348811de4de445e776a85a71e3f9b 100644 (file)
@@ -613,8 +613,7 @@ _dbus_test_test_int (Test* self,
        g_variant_unref (_tmp28_);
        result = test_test_int (self, i, i_length1, &j, &j_length1, &result_length1, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -695,8 +694,7 @@ _dbus_test_test_string (Test* self,
        g_variant_unref (_tmp38_);
        result = test_test_string (self, s, s_length1, &t, &t_length1, &result_length1, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 5bc147231caa1997c59e21acbbbdf31824ebbeae..9d5c3921e1d87c5b25d3896dfea0e786a804a349 100644 (file)
@@ -226,8 +226,7 @@ _dbus_test_get_test (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_get_test (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 2986ba1768e04cc69a2416b2a94d405ca3e2b31e..014c26f9447007b7e28e7da1336a320826a800ca 100644 (file)
@@ -188,8 +188,7 @@ _dbus_test_get_test (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_get_test (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 30ee60393c50eca95dbb440fa1e3291137151855..60becc0d0d0cc9a88f0a2be912a60da82c6dfc4e 100644 (file)
@@ -226,8 +226,7 @@ _dbus_test_get_test (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_get_test (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index ef52a336dda784aa0cc876ccb15028d5244f0f40..c1c589bb3cca8da3eed4c5fda4300617b303e6e4 100644 (file)
@@ -188,8 +188,7 @@ _dbus_test_get_test (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_get_test (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 4f9a12a28cdc9a76b3ad47cb93eebd1053e6ffef..c8b3343978eef3aad3996954d19b24617c6af601 100644 (file)
@@ -662,8 +662,7 @@ _dbus_test_test_void_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        test_test_void_finish ((Test*) source_object, _res_, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -711,8 +710,7 @@ _dbus_test_test_int_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        result = test_test_int_finish ((Test*) source_object, _res_, &j, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -764,8 +762,7 @@ _dbus_test_test_string_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        result = test_test_string_finish ((Test*) source_object, _res_, &t, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -812,8 +809,7 @@ _dbus_test_test_cancellable_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        test_test_cancellable_finish ((Test*) source_object, _res_, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 819beebe704db0f9d1f9a35b6bc58eabcf03641a..702f27b11d2ec2ac7804993ec81c6e0a3c38414f 100644 (file)
@@ -668,8 +668,7 @@ _dbus_test_test_void_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        test_test_void_finish ((Test*) source_object, _res_, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -717,8 +716,7 @@ _dbus_test_test_int_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        result = test_test_int_finish ((Test*) source_object, _res_, &j, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -770,8 +768,7 @@ _dbus_test_test_string_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        result = test_test_string_finish ((Test*) source_object, _res_, &t, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -818,8 +815,7 @@ _dbus_test_test_cancellable_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        test_test_cancellable_finish ((Test*) source_object, _res_, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index abb397e7d24178ca96f01269a66d19b24f306ccd..2077f87800ceaffc5f066e3dbd65bc182bd2b2a9 100644 (file)
@@ -519,8 +519,7 @@ _dbus_test_list_messages_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        result = test_list_messages_finish ((Test*) source_object, _res_, &result_length1, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -576,8 +575,7 @@ _dbus_test_post_message_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        test_post_message_finish ((Test*) source_object, _res_, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 659449fc2021579090e3971377bc4b96a19f43ad..fd2848a5fd1bfb436b2b0005a341c42966cd9cd7 100644 (file)
@@ -571,8 +571,7 @@ _dbus_test_test_void_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        test_test_void_finish ((Test*) source_object, _res_, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -620,8 +619,7 @@ _dbus_test_test_int_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        result = test_test_int_finish ((Test*) source_object, _res_, &j, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -673,8 +671,7 @@ _dbus_test_test_string_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        result = test_test_string_finish ((Test*) source_object, _res_, &t, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 6d1d4b65cd53d1db6fd790447d7b00c43f4df327..0621c47c4a0e9ffe66257ad15e0a3dd4e104aba4 100644 (file)
@@ -532,8 +532,7 @@ _dbus_test_test_void (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        test_test_void (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -565,8 +564,7 @@ _dbus_test_test_int (Test* self,
        g_variant_unref (_tmp7_);
        result = test_test_int (self, i, &j, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -600,8 +598,7 @@ _dbus_test_test_string (Test* self,
        g_variant_unref (_tmp8_);
        result = test_test_string (self, s, &t, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 38836347a3c52f27a4b44c2cfbddadbd8e2ab6c9..67aaa5ebbf072018c43ac07927816070c7808fb2 100644 (file)
@@ -224,8 +224,7 @@ _dbus_test_test_string (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_test_string (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index dae32bff8a963a0734e6946edd5492611557cee7..0d1bf6e9ee47351458c7c1b6fb4bf1f51bbad604 100644 (file)
@@ -482,8 +482,7 @@ _dbus_test_array (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_array (self, &result_length1, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -522,8 +521,7 @@ _dbus_test_multi_array (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_multi_array (self, &result_length1, &result_length2, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -569,8 +567,7 @@ _dbus_test_multi_array2 (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_multi_array2 (self, &result_length1, &result_length2, &result_length3, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index a5883c89f9e4372f046aec6e44244f6c92d84ae0..1c3c1fe2cb4150f2a358c08b89ce54af2919a8f1 100644 (file)
@@ -247,8 +247,7 @@ _dbus_test_test_nested_dict (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_test_nested_dict (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index f87ad4c6a22fe4fce5de8b5e8814822df1fbced5..796a283954122df42ac232d68bc0a23d3a274e25 100644 (file)
@@ -379,8 +379,7 @@ _dbus_test_test_array_lifetime_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        result = test_test_array_lifetime_finish ((Test*) source_object, _res_, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 3b2a6e4a02130e6afc3db0c56492dc8d1d185fe0..373027c4313d769ab54dd6d14241b1679dd75b11 100644 (file)
@@ -430,8 +430,7 @@ _dbus_test_test_array_lifetime_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        result = test_test_array_lifetime_finish ((Test*) source_object, _res_, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 63cea38d32db7836020b6bbf0c3d070ce32f8df1..f43be75571978561e24d0b55def128009aeddfaf 100644 (file)
@@ -365,8 +365,7 @@ _dbus_ifoo_method0 (IFoo* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        ifoo_method0 (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -391,8 +390,7 @@ _dbus_ifoo_method1 (IFoo* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        ifoo_method1 (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -572,8 +570,7 @@ _dbus_foo_method0 (Foo* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        foo_method0 (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -598,8 +595,7 @@ _dbus_foo_method1 (Foo* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        foo_method1 (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index d25dbb971514d5c8b494a9f8324befd5b19e6345..026ef7bf49a4772a143c402e714830addb42ad5b 100644 (file)
@@ -217,8 +217,7 @@ _dbus_test_get_test (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_get_test (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 3dabf4b274e9f03b6de0f418145701946bebc338..ab9db7747b7ee2e1803778b18b28c485417c3140 100644 (file)
@@ -188,8 +188,7 @@ _dbus_test_get_test (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_get_test (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index d7de6e2fcc021701eb70120257ea64e20bc86d05..6e6aee9eac4add456a3c488753ca8eeb09515599 100644 (file)
@@ -238,8 +238,7 @@ _dbus_test_test_dict (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_test_dict (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 90cafa765c379f018ef7cc1caa99fb3d67ff5dad..5787f45d72dc3ab2126961b5187aa242227ef1d1 100644 (file)
@@ -586,8 +586,7 @@ _dbus_test_interface_bar_foo (TestInterfaceBar* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_interface_bar_foo (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index f8864be40dfd7336fc031e8b3124931a746ffdbd..d99ad961222f3925f8af0d22914596440c1de414 100644 (file)
@@ -212,8 +212,7 @@ _dbus_test_do_foo (Test* self,
        g_variant_unref (_tmp0_);
        result = test_do_foo (self, i, &s, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index bf75b7b5aeeb6e8ac84cd7994894efab2ae8107c..48974d471e8a1423c7518534f96bd1f0640f03a4 100644 (file)
@@ -591,8 +591,7 @@ _dbus_test_test1 (Test* self,
        _ready_data->e = foo_enum_from_string (g_variant_get_string (_tmp0_, NULL), &error);
        g_variant_unref (_tmp0_);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        test_test1 (self, _ready_data->e, (GAsyncReadyCallback) _dbus_test_test1_ready, _ready_data);
@@ -613,8 +612,7 @@ _dbus_test_test1_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        test_test1_finish ((Test*) source_object, _res_, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -645,14 +643,12 @@ _dbus_test_test2 (Test* self,
        e = foo_enum_from_string (g_variant_get_string (_tmp1_, NULL), &error);
        g_variant_unref (_tmp1_);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        test_test2 (self, e, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -685,8 +681,7 @@ _dbus_test_test3 (Test* self,
        e1 = foo_enum_from_string (g_variant_get_string (_tmp2_, NULL), &error);
        g_variant_unref (_tmp2_);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _tmp3_ = g_variant_iter_next_value (&_arguments_iter);
@@ -696,14 +691,12 @@ _dbus_test_test3 (Test* self,
        e2 = foo_enum_from_string (g_variant_get_string (_tmp4_, NULL), &error);
        g_variant_unref (_tmp4_);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        test_test3 (self, e1, fd, e2, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -732,8 +725,7 @@ _dbus_test_test4 (Test* self,
        e = foo_enum_from_string (g_variant_get_string (_tmp5_, NULL), &error);
        g_variant_unref (_tmp5_);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        test_test4 (self, e);
@@ -762,8 +754,7 @@ _dbus_test_test5 (Test* self,
        _ready_data->e = foo_enum_from_string (g_variant_get_string (_tmp6_, NULL), &error);
        g_variant_unref (_tmp6_);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        test_test5 (self, _ready_data->e, (GAsyncReadyCallback) _dbus_test_test5_ready, _ready_data);
index f8f2acc0471009970d89a6f9b90542445008e06b..b3e4476d689c0c3fe918ce97dba34c11eb2ce74b 100644 (file)
@@ -476,8 +476,7 @@ _dbus_test_test_void (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        test_test_void (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -509,8 +508,7 @@ _dbus_test_test_int (Test* self,
        g_variant_unref (_tmp6_);
        result = test_test_int (self, i, &j, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -544,8 +542,7 @@ _dbus_test_test_string (Test* self,
        g_variant_unref (_tmp7_);
        result = test_test_string (self, s, &t, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -577,8 +574,7 @@ _dbus_test_test_cancellable (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        test_test_cancellable (self, NULL, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -603,8 +599,7 @@ _dbus_test_test_custom_error (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        test_test_custom_error (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 805cf6aaeb9882d261417aba65b8c0819c68d5b0..c26fe466ef8590e3fdc7cacbd2a755976aea6347 100644 (file)
@@ -312,8 +312,7 @@ _dbus_test_test_void (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        test_test_void (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -345,8 +344,7 @@ _dbus_test_test_int (Test* self,
        g_variant_unref (_tmp0_);
        result = test_test_int (self, i, &j, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -380,8 +378,7 @@ _dbus_test_test_string (Test* self,
        g_variant_unref (_tmp1_);
        result = test_test_string (self, s, &t, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -413,8 +410,7 @@ _dbus_test_test_cancellable (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        test_test_cancellable (self, NULL, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -439,8 +435,7 @@ _dbus_test_test_custom_error (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        test_test_custom_error (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 0c6bcb8d01a5128eefd7adb6d3c51839050cdf2c..48950f085db7558147c34bec6dd2132219c2b7bf 100644 (file)
@@ -403,8 +403,7 @@ _dbus_test_test_in (Test* self,
                g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, "FD List is NULL");
        }
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        test_test_in (self, _ready_data->i, (GAsyncReadyCallback) _dbus_test_test_in_ready, _ready_data);
@@ -430,8 +429,7 @@ _dbus_test_test_in_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        result = test_test_in_finish ((Test*) source_object, _res_, &j, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 33898dab0f1551049267b6d3cfdd7bb1116f140b..cad4f992446c54d664787f2cb7950a3bad561d32 100644 (file)
@@ -430,8 +430,7 @@ _dbus_test_test_in (Test* self,
                g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, "FD List is NULL");
        }
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        test_test_in (self, _ready_data->i, (GAsyncReadyCallback) _dbus_test_test_in_ready, _ready_data);
@@ -457,8 +456,7 @@ _dbus_test_test_in_ready (GObject * source_object,
        invocation = _ready_data->_invocation_;
        result = test_test_in_finish ((Test*) source_object, _res_, &j, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index dde04e5dd4f2682a0e29c58e85650a31079cbb12..81354210a3e08b2d541ad2125c51233b972d255f 100644 (file)
@@ -244,14 +244,12 @@ _dbus_test_test (Test* self,
                g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, "FD List is NULL");
        }
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        result = test_test (self, output_stream, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 6067ff0bb406060270f690682ed45609a76c8c0f..ffebe40d7d6da2c9a6a79c312e5b0fc43cf3b927 100644 (file)
@@ -228,14 +228,12 @@ _dbus_test_test (Test* self,
                g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, "FD List is NULL");
        }
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        test_test (self, output_stream, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index d22be7c38328495da431b539079d3b9fcc1b0491..82312fc95cecb101ee2ba6953a667af49566df58 100644 (file)
@@ -274,14 +274,12 @@ _dbus_test_test_in (Test* self,
                g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, "FD List is NULL");
        }
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        result = test_test_in (self, i, &j, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 86a6b71c35da0b4e9da7f20278cb0d0de2f45215..ea51e67d3ba9dd5fd75949c30bec7a88bcc37b67 100644 (file)
@@ -324,14 +324,12 @@ _dbus_test_test_in (Test* self,
                g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, "FD List is NULL");
        }
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        result = test_test_in (self, i, &j, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index eaada2f078c8fb7a446bd2c797e2fe12398627cb..71b18d5639841a86e8d2db2cb3f14e70d9675b84 100644 (file)
@@ -224,8 +224,7 @@ _dbus_test_get_test (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_get_test (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 92346b30d6970f32923750de69fe827ac27a56c4..a69750d2cded7e2154293df181293f7be32d1180 100644 (file)
@@ -199,8 +199,7 @@ _dbus_test_get_test (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_get_test (self, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 106c9a2b2959623d83ad48df2dbf5ea587dfb8ba..ea44e8ea4390a5e11674b229da187e229168fe00 100644 (file)
@@ -444,8 +444,7 @@ _dbus_test_list_messages (Test* self,
        g_variant_iter_init (&_arguments_iter, _parameters_);
        result = test_list_messages (self, &result_length1, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -483,8 +482,7 @@ _dbus_test_post_message (Test* self,
        g_variant_unref (_tmp7_);
        test_post_message (self, message, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 287614547078d0ba3f6902321dd0241a1241f022..7137822ee11f994587897f68b7760b82e61d96d8 100644 (file)
@@ -492,8 +492,7 @@ _dbus_test_test_method (Test* self,
        g_variant_unref (_tmp5_);
        result = test_test_method (self, j, k, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -853,8 +852,7 @@ _dbus_test_raw_test_method (TestRaw* self,
        k = g_variant_iter_next_value (&_arguments_iter);
        result = test_raw_test_method (self, j, k, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index b172477d0eca960cc0cdefe8c24932a4665451e1..0cf155bf51bca247bbf3772f1272b19a2a144a5d 100644 (file)
@@ -422,8 +422,7 @@ _dbus_test_do_foo (Test* self,
        g_variant_unref (_tmp8_);
        test_do_foo (self, i, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -475,8 +474,7 @@ _dbus_test_do_bar (Test* self,
        g_variant_unref (_tmp9_);
        test_do_bar (self, baz, baz_length1, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index da9b02267919cd3d24abb57c244d13526cb8b50c..d9876992f92f44bd5202ecc50fb76f576a6ddc16 100644 (file)
@@ -269,8 +269,7 @@ _dbus_test_do_foo (Test* self,
        g_variant_unref (_tmp0_);
        test_do_foo (self, i, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                return;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
@@ -322,8 +321,7 @@ _dbus_test_do_bar (Test* self,
        g_variant_unref (_tmp1_);
        test_do_bar (self, baz, baz_length1, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
index 91c61053a51257f5c6028ac9c0e4f6fd9dda588c..3345df8c2d0a41fd4937146b4604f378200186b0 100644 (file)
@@ -468,8 +468,7 @@ _dbus_test_test_struct (Test* self,
        g_variant_unref (_tmp16_);
        test_test_struct (self, &f, &g, &result, &error);
        if (error) {
-               g_dbus_method_invocation_return_gerror (invocation, error);
-               g_error_free (error);
+               g_dbus_method_invocation_take_error (invocation, error);
                goto _error;
        }
        _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));