From c6298ede72f352cc76a2c3e774311b551852d6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 26 Nov 2019 20:43:33 +0100 Subject: [PATCH] fp-device: Unref the print once we've notified the progress When we notify the enroll progress with a print, this needs to be unreffed once we're done, but this only was happening in case of error. Since it's not up to the callback function to free it, let's do it at the end of the function. As per this, clarify the docs for FpEnrollProgress marking it as transfer none. --- libfprint/fp-device.c | 2 ++ libfprint/fp-device.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libfprint/fp-device.c b/libfprint/fp-device.c index b2190bd9..c9d1b893 100644 --- a/libfprint/fp-device.c +++ b/libfprint/fp-device.c @@ -2344,6 +2344,8 @@ fpi_device_enroll_progress (FpDevice *device, } if (error) g_error_free (error); + + g_clear_object (&print); } diff --git a/libfprint/fp-device.h b/libfprint/fp-device.h index 821514d7..47850649 100644 --- a/libfprint/fp-device.h +++ b/libfprint/fp-device.h @@ -113,7 +113,7 @@ GQuark fp_device_error_quark (void); * FpEnrollProgress: * @device: a #FpDevice * @completed_stages: Number of completed stages - * @print: (nullable): The last scaned print + * @print: (nullable) (transfer none): The last scaned print * @user_data: (nullable): User provided data * @error: (nullable) (transfer none): #GError or %NULL *