From a137f1a84f6e50e19a70cfa9247b29725f22432a Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Mon, 25 Jan 2021 12:58:30 +0000 Subject: [PATCH] xb-silo: Cancel the GFileMonitor before unreffing it GFileMonitors currently need to be explicitly cancelled when they are unreffed, otherwise they can deadlock due to the GLib-internal worker thread also holding a strong reference to the monitor. For full details, see: https://gitlab.gnome.org/GNOME/glib/-/issues/1941 Closes #59 --- src/xb-silo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xb-silo.c b/src/xb-silo.c index 282ec88..c9f6aac 100644 --- a/src/xb-silo.c +++ b/src/xb-silo.c @@ -1349,6 +1349,7 @@ xb_silo_machine_fixup_attr_text_cb (XbMachine *self, static void xb_silo_file_monitor_item_free (XbSiloFileMonitorItem *item) { + g_file_monitor_cancel (item->file_monitor); g_signal_handler_disconnect (item->file_monitor, item->file_monitor_id); g_object_unref (item->file_monitor); g_slice_free (XbSiloFileMonitorItem, item);