libfprint/SOURCES/0038-fp-context-Run-dispose...

29 lines
1006 B
Diff

From e2419698d6c87a5d5a822acf4d5891a464f68317 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
Date: Tue, 26 Nov 2019 19:16:07 +0100
Subject: [PATCH 038/181] fp-context: Run dispose on the usb context to deal
with circular refs
Ensure that we dispose the USB context before unreffing it, so that it will
release any reference it has and destroy the internal libusb context.
---
libfprint/fp-context.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libfprint/fp-context.c b/libfprint/fp-context.c
index 74dda51..eed7847 100644
--- a/libfprint/fp-context.c
+++ b/libfprint/fp-context.c
@@ -186,6 +186,8 @@ fp_context_finalize (GObject *object)
g_cancellable_cancel (priv->cancellable);
g_clear_object (&priv->cancellable);
g_clear_pointer (&priv->drivers, g_array_unref);
+
+ g_object_run_dispose (G_OBJECT (priv->usb_ctx));
g_clear_object (&priv->usb_ctx);
G_OBJECT_CLASS (fp_context_parent_class)->finalize (object);
--
2.24.1