mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-09-11 05:10:05 +00:00
mafpmoc: Cleanup handling of identify and matching prints
Make clearer the ownership of the prints we're tracking
This commit is contained in:
@@ -1556,6 +1556,7 @@ fp_verify_get_tpl_info_cb (FpiDeviceMafpmoc *self,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self->identify_match_print = matching;
|
self->identify_match_print = matching;
|
||||||
self->identify_new_print = new_scan;
|
self->identify_new_print = new_scan;
|
||||||
|
|
||||||
@@ -1865,6 +1866,8 @@ fp_verify_ssm_done (FpiSsm *ssm, FpDevice *dev, GError *error)
|
|||||||
{
|
{
|
||||||
fp_dbg ("verify completed");
|
fp_dbg ("verify completed");
|
||||||
FpiDeviceMafpmoc *self = FPI_DEVICE_MAFPMOC (dev);
|
FpiDeviceMafpmoc *self = FPI_DEVICE_MAFPMOC (dev);
|
||||||
|
g_autoptr(FpPrint) new_print = g_steal_pointer (&self->identify_new_print);
|
||||||
|
FpPrint *match_print = g_steal_pointer (&self->identify_match_print);
|
||||||
|
|
||||||
self->task_ssm = NULL;
|
self->task_ssm = NULL;
|
||||||
|
|
||||||
@@ -1874,19 +1877,29 @@ fp_verify_ssm_done (FpiSsm *ssm, FpDevice *dev, GError *error)
|
|||||||
fpi_device_verify_report (dev, FPI_MATCH_ERROR, NULL, g_steal_pointer (&error));
|
fpi_device_verify_report (dev, FPI_MATCH_ERROR, NULL, g_steal_pointer (&error));
|
||||||
else
|
else
|
||||||
fpi_device_identify_report (dev, NULL, NULL, g_steal_pointer (&error));
|
fpi_device_identify_report (dev, NULL, NULL, g_steal_pointer (&error));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
fpi_device_action_error (dev, g_steal_pointer (&error));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fpi_device_get_current_action (dev) == FPI_DEVICE_ACTION_VERIFY)
|
if (fpi_device_get_current_action (dev) == FPI_DEVICE_ACTION_VERIFY)
|
||||||
{
|
{
|
||||||
fpi_device_verify_report (dev, self->identify_match_print ? FPI_MATCH_SUCCESS : FPI_MATCH_FAIL,
|
fpi_device_verify_report (dev, match_print ? FPI_MATCH_SUCCESS : FPI_MATCH_FAIL,
|
||||||
self->identify_new_print, NULL);
|
g_steal_pointer (&new_print), NULL);
|
||||||
fpi_device_verify_complete (dev, error);
|
fpi_device_verify_complete (dev, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fpi_device_identify_report (dev, self->identify_match_print,
|
fpi_device_identify_report (dev, match_print,
|
||||||
self->enroll_dupl_del_state ? self->identify_new_print : NULL, NULL);
|
self->enroll_dupl_del_state ?
|
||||||
fpi_device_identify_complete (dev, error);
|
g_steal_pointer (&new_print) : NULL,
|
||||||
|
NULL);
|
||||||
|
fpi_device_identify_complete (dev, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2370,7 +2383,8 @@ mafp_verify_identify (FpDevice *device)
|
|||||||
self->press_state = MAFP_PRESS_WAIT_UP;
|
self->press_state = MAFP_PRESS_WAIT_UP;
|
||||||
self->capture_cnt = 0;
|
self->capture_cnt = 0;
|
||||||
self->identify_match_print = NULL;
|
self->identify_match_print = NULL;
|
||||||
self->identify_new_print = NULL;
|
g_clear_object (&self->identify_new_print);
|
||||||
|
|
||||||
self->task_ssm = fpi_ssm_new_full (device, fp_verify_sm_run_state,
|
self->task_ssm = fpi_ssm_new_full (device, fp_verify_sm_run_state,
|
||||||
FP_VERIFY_STATES,
|
FP_VERIFY_STATES,
|
||||||
FP_VERIFY_EXIT,
|
FP_VERIFY_EXIT,
|
||||||
|
|||||||
Reference in New Issue
Block a user