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.
This commit is contained in:
Marco Trevisan (Treviño) 2019-11-26 20:43:33 +01:00
parent b1d99e7608
commit c6298ede72
2 changed files with 3 additions and 1 deletions

View file

@ -2344,6 +2344,8 @@ fpi_device_enroll_progress (FpDevice *device,
}
if (error)
g_error_free (error);
g_clear_object (&print);
}

View file

@ -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
*