From 5a1253e37c52f0aef50ccc8ac8bd61af8d123f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 24 Nov 2023 21:02:50 +0100 Subject: [PATCH] fp-image: Do not start thread detection task thread if already running --- libfprint/fp-image.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libfprint/fp-image.c b/libfprint/fp-image.c index 4c4864fd..f9c60b37 100644 --- a/libfprint/fp-image.c +++ b/libfprint/fp-image.c @@ -474,8 +474,11 @@ fp_image_detect_minutiae (FpImage *self, if (!g_atomic_int_compare_and_exchange (&self->detection_in_progress, FALSE, TRUE)) - g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_ADDRESS_IN_USE, - "Minutiae detection is already in progress"); + { + g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_ADDRESS_IN_USE, + "Minutiae detection is already in progress"); + return; + } g_task_run_in_thread (g_steal_pointer (&task), fp_image_detect_minutiae_nbis_thread_func);