From 6119bb0042440ad0a462d69f135731e9e01b3311 Mon Sep 17 00:00:00 2001 From: Colin Kinloch Date: Sun, 16 Feb 2025 14:43:07 +0000 Subject: [PATCH] gio/gvolumemonitor: Suggest disconnecting signals It is easy to overlook that unreffing a GVolumeMonitor doesn't disconnect signal handlers, this can lead to segfaults from dangling user data pointers. --- gio/gunionvolumemonitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gunionvolumemonitor.c b/gio/gunionvolumemonitor.c index 10c2e7431..42bb5dd60 100644 --- a/gio/gunionvolumemonitor.c +++ b/gio/gunionvolumemonitor.c @@ -507,7 +507,7 @@ g_union_volume_monitor_new (void) * Gets the volume monitor used by gio. * * Returns: (transfer full): a reference to the #GVolumeMonitor used by gio. Call - * g_object_unref() when done with it. + * g_object_unref() when done with it, after disconnecting any signal handlers. **/ GVolumeMonitor * g_volume_monitor_get (void)