diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libqmi-glib/qmi-proxy.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/libqmi-glib/qmi-proxy.c b/src/libqmi-glib/qmi-proxy.c index 094148ed..eeff4bf0 100644 --- a/src/libqmi-glib/qmi-proxy.c +++ b/src/libqmi-glib/qmi-proxy.c @@ -168,6 +168,8 @@ client_unref (Client *client) } } +G_DEFINE_AUTOPTR_CLEANUP_FUNC (Client, client_unref) + static Client * client_ref (Client *client) { @@ -941,15 +943,17 @@ parse_request (QmiProxy *self, } static gboolean -connection_readable_cb (GSocket *socket, - GIOCondition condition, - Client *client) +connection_readable_cb (GSocket *socket, + GIOCondition condition, + Client *_client) { - QmiProxy *self; - guint8 buffer[BUFFER_SIZE]; - GError *error = NULL; - gssize r; + g_autoptr(Client) client = NULL; + QmiProxy *self; + guint8 buffer[BUFFER_SIZE]; + GError *error = NULL; + gssize r; + client = client_ref (_client); self = client->proxy; if (condition & G_IO_IN || condition & G_IO_PRI) { |