Blob Blame History Raw
From 8b270141f32411a02dffa1833564a8dafe6c1fd3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
Date: Fri, 22 Nov 2019 13:06:08 +0100
Subject: [PATCH 015/181] image-device: Use g_clear_handle_id for timeouts

As per this depend on glib 2.56: it has been released almost 2 years ago,
I suppose we're fine with that.
---
 libfprint/fp-image-device.c | 12 ++----------
 meson.build                 |  2 +-
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/libfprint/fp-image-device.c b/libfprint/fp-image-device.c
index 65cca16..44de578 100644
--- a/libfprint/fp-image-device.c
+++ b/libfprint/fp-image-device.c
@@ -80,11 +80,7 @@ fp_image_device_change_state (FpImageDevice *self, FpImageDeviceState state)
 
   /* We might have been waiting for the finger to go OFF to start the
    * next operation. */
-  if (priv->pending_activation_timeout_id)
-    {
-      g_source_remove (priv->pending_activation_timeout_id);
-      priv->pending_activation_timeout_id = 0;
-    }
+  g_clear_handle_id (&priv->pending_activation_timeout_id, g_source_remove);
 
   fp_dbg ("Image device internal state change from %d to %d\n", priv->state, state);
 
@@ -110,11 +106,7 @@ fp_image_device_activate (FpImageDevice *self)
 
   /* We might have been waiting for deactivation to finish before
    * starting the next operation. */
-  if (priv->pending_activation_timeout_id)
-    {
-      g_source_remove (priv->pending_activation_timeout_id);
-      priv->pending_activation_timeout_id = 0;
-    }
+  g_clear_handle_id (&priv->pending_activation_timeout_id, g_source_remove);
 
   fp_dbg ("Activating image device\n");
   cls->activate (self);
diff --git a/meson.build b/meson.build
index cf277f5..ef352ba 100644
--- a/meson.build
+++ b/meson.build
@@ -18,7 +18,7 @@ libfprint_conf = configuration_data()
 cc = meson.get_compiler('c')
 cpp = meson.get_compiler('cpp')
 host_system = host_machine.system()
-glib_min_version = '2.50'
+glib_min_version = '2.56'
 
 glib_version_def = 'GLIB_VERSION_@0@_@1@'.format(
     glib_min_version.split('.')[0], glib_min_version.split('.')[1])
-- 
2.24.1