diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2020-01-15 11:46:24 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2020-01-15 11:46:24 +0100 |
commit | 99443500fd78494fc745bac745fbb500d97d2d50 (patch) | |
tree | 961b161433199abd58487a61eaecfe642fe28a02 /build-aux | |
parent | 82330aedfb2490197efaed22394720c6ab8caed0 (diff) |
qmi-codegen,client: use g_autoptr when handling abortable messages
Diffstat (limited to 'build-aux')
-rw-r--r-- | build-aux/qmi-codegen/Client.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/build-aux/qmi-codegen/Client.py b/build-aux/qmi-codegen/Client.py index 116af86..5f3cc96 100644 --- a/build-aux/qmi-codegen/Client.py +++ b/build-aux/qmi-codegen/Client.py @@ -384,7 +384,7 @@ class Client: '{\n' ' QmiMessage *abort_request;\n' ' guint16 transaction_id;\n' - ' QmiMessage${service_camelcase}AbortInput *input;\n' + ' g_autoptr(QmiMessage${service_camelcase}AbortInput) input = NULL;\n' '\n' ' transaction_id = qmi_message_get_transaction_id (message);\n' ' g_assert (transaction_id != 0);\n' @@ -399,7 +399,6 @@ class Client: ' qmi_client_get_cid (client),\n' ' input,\n' ' NULL);\n' - ' qmi_message_${service_lowercase}_abort_input_unref (input);\n' ' return abort_request;\n' '}\n' '\n' @@ -410,15 +409,12 @@ class Client: ' QmiClient *client,\n' ' GError **error)\n' '{\n' - ' QmiMessage${service_camelcase}AbortOutput *output;\n' + ' g_autoptr(QmiMessage${service_camelcase}AbortOutput) output = NULL;\n' '\n' ' output = __qmi_message_${service_lowercase}_abort_response_parse (\n' ' abort_response,\n' ' error);\n' - ' if (!output)\n' - ' return FALSE;\n' - ' qmi_message_${service_lowercase}_abort_output_unref (output);\n' - ' return TRUE;\n' + ' return !!output;\n' '}\n') template += ( |