From 70d5ff3c52820840344df1a3e3b83a07dfb8e672 Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Thu, 13 Jul 2023 10:15:03 +0200 Subject: [PATCH] udisks2: Disconnect signal handlers before freeing data After the commit 1b80450a, the udisks2 volume monitor crashes sometimes after showing the unmount notification. This is because the `UnmountNotifyData` struct is freed, but signal handlers are still connected. Let's disconnect the signal handlers to avoid those crashes caused by invalid reads. Related: https://bugzilla.redhat.com/show_bug.cgi?id=2219172 --- monitor/udisks2/gvfsudisks2utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/monitor/udisks2/gvfsudisks2utils.c b/monitor/udisks2/gvfsudisks2utils.c index 1f48ceb0..345c93ab 100644 --- a/monitor/udisks2/gvfsudisks2utils.c +++ b/monitor/udisks2/gvfsudisks2utils.c @@ -709,6 +709,7 @@ unmount_notify_data_free (gpointer user_data) UnmountNotifyData *data = user_data; unmount_notify_stop_timer (data); + g_signal_handlers_disconnect_by_data (data->op, data); g_clear_object (&data->mount); g_clear_object (&data->drive); -- 2.41.0