aboutsummaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-01-15 11:46:51 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-01-15 11:46:51 +0100
commit9a51ad256f29b213a4288bf5a3e85b6fd73c853f (patch)
tree6ed0305554a563fc7ab34ac8b926861a6e09dbc6 /build-aux
parent99443500fd78494fc745bac745fbb500d97d2d50 (diff)
qmi-codegen,client: use g_autoptr in request handling
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/qmi-codegen/Client.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/build-aux/qmi-codegen/Client.py b/build-aux/qmi-codegen/Client.py
index 5f3cc96..8948d5b 100644
--- a/build-aux/qmi-codegen/Client.py
+++ b/build-aux/qmi-codegen/Client.py
@@ -468,13 +468,13 @@ class Client:
' gpointer user_data)\n'
'{\n'
' GTask *task;\n'
- ' QmiMessage *request;\n'
' GError *error = NULL;\n'
- ' guint16 transaction_id;\n')
+ ' guint16 transaction_id;\n'
+ ' g_autoptr(QmiMessage) request = NULL;\n')
if message.vendor is not None:
template += (
- ' QmiMessageContext *context;\n')
+ ' g_autoptr(QmiMessageContext) context = NULL;\n')
template += (
'\n'
@@ -538,12 +538,7 @@ class Client:
template += (
' cancellable,\n'
' (GAsyncReadyCallback)${message_underscore}_ready,\n'
- ' task);\n'
- ' qmi_message_unref (request);\n')
-
- if message.vendor is not None:
- template += (
- ' qmi_message_context_unref (context);\n')
+ ' task);\n')
template += (
'}\n'