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.
This commit is contained in:
Colin Kinloch 2025-02-16 14:43:07 +00:00
parent 4738951270
commit 6119bb0042

View File

@ -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)