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.
This commit is contained in:
Marco Trevisan (Treviño) 2019-11-26 19:16:07 +01:00
parent 71625ec1cf
commit 5dc3edf07c

View file

@ -186,6 +186,8 @@ fp_context_finalize (GObject *object)
g_cancellable_cancel (priv->cancellable); g_cancellable_cancel (priv->cancellable);
g_clear_object (&priv->cancellable); g_clear_object (&priv->cancellable);
g_clear_pointer (&priv->drivers, g_array_unref); g_clear_pointer (&priv->drivers, g_array_unref);
g_object_run_dispose (G_OBJECT (priv->usb_ctx));
g_clear_object (&priv->usb_ctx); g_clear_object (&priv->usb_ctx);
G_OBJECT_CLASS (fp_context_parent_class)->finalize (object); G_OBJECT_CLASS (fp_context_parent_class)->finalize (object);