mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
egismoc: Use an autopointer to cleanup error on command done callback
This commit is contained in:
@@ -247,19 +247,15 @@ egismoc_cmd_ssm_done (FpiSsm *ssm,
|
|||||||
FpDevice *device,
|
FpDevice *device,
|
||||||
GError *error)
|
GError *error)
|
||||||
{
|
{
|
||||||
|
g_autoptr(GError) local_error = error;
|
||||||
FpiDeviceEgisMoc *self = FPI_DEVICE_EGISMOC (device);
|
FpiDeviceEgisMoc *self = FPI_DEVICE_EGISMOC (device);
|
||||||
CommandData *data = fpi_ssm_get_data (ssm);
|
CommandData *data = fpi_ssm_get_data (ssm);
|
||||||
|
|
||||||
self->cmd_ssm = NULL;
|
self->cmd_ssm = NULL;
|
||||||
self->cmd_transfer = NULL;
|
self->cmd_transfer = NULL;
|
||||||
|
|
||||||
if (error)
|
if (error && data && data->callback)
|
||||||
{
|
data->callback (device, NULL, 0, g_steal_pointer (&local_error));
|
||||||
if (data->callback)
|
|
||||||
data->callback (device, NULL, 0, error);
|
|
||||||
else
|
|
||||||
g_error_free (error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef union egismoc_check_bytes
|
typedef union egismoc_check_bytes
|
||||||
|
|||||||
Reference in New Issue
Block a user