fpi-device: Make possible to set a DestroyNotify for timeout data

Since GSource data can be automatically cleaned up on source destruction, we
can mimic this for the devices timeout easily as well.

Add an extra parameter, and let's use this cocci file to adapt all the
drivers like magic:

	@@
	expression e1, e2, e3, e4;
	@@
	fpi_device_add_timeout (e1, e2, e3, e4
	+  , NULL
  	)
This commit is contained in:
Marco Trevisan (Treviño)
2019-11-22 17:11:29 +01:00
parent 0241617713
commit 3ed73aa17c
8 changed files with 23 additions and 21 deletions

View File

@@ -203,11 +203,11 @@ void fpi_device_get_delete_data (FpDevice *device,
GCancellable *fpi_device_get_cancellable (FpDevice *device);
GSource * fpi_device_add_timeout (FpDevice *device,
gint interval,
FpTimeoutFunc func,
gpointer user_data);
GSource * fpi_device_add_timeout (FpDevice *device,
gint interval,
FpTimeoutFunc func,
gpointer user_data,
GDestroyNotify destroy_notify);
void fpi_device_set_nr_enroll_stages (FpDevice *device,
gint enroll_stages);