mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-06 07:58:44 +02:00
Bug 573970 – crash in gunixvolumemonitor:update_mounts when unmounting
2009-03-04 Alexander Larsson <alexl@redhat.com> Bug 573970 – crash in gunixvolumemonitor:update_mounts when unmounting * gunionvolumemonitor.c: (g_union_volume_monitor_dispose): Run dispose on child monitors when disposing. * gunixvolumemonitor.c: Remove all volumes and mount on dispose to avoid circular dependencies not freeing the monitor svn path=/trunk/; revision=7957
This commit is contained in:
committed by
Alexander Larsson
parent
011901da58
commit
73477419e8
@@ -90,6 +90,23 @@ g_unix_volume_monitor_finalize (GObject *object)
|
||||
G_OBJECT_CLASS (g_unix_volume_monitor_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
g_unix_volume_monitor_dispose (GObject *object)
|
||||
{
|
||||
GUnixVolumeMonitor *monitor;
|
||||
|
||||
monitor = G_UNIX_VOLUME_MONITOR (object);
|
||||
g_list_foreach (monitor->volumes, (GFunc)g_object_unref, NULL);
|
||||
g_list_free (monitor->volumes);
|
||||
monitor->volumes = NULL;
|
||||
|
||||
g_list_foreach (monitor->mounts, (GFunc)g_object_unref, NULL);
|
||||
g_list_free (monitor->mounts);
|
||||
monitor->mounts = NULL;
|
||||
|
||||
G_OBJECT_CLASS (g_unix_volume_monitor_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static GList *
|
||||
get_mounts (GVolumeMonitor *volume_monitor)
|
||||
{
|
||||
@@ -170,6 +187,7 @@ g_unix_volume_monitor_class_init (GUnixVolumeMonitorClass *klass)
|
||||
GNativeVolumeMonitorClass *native_class = G_NATIVE_VOLUME_MONITOR_CLASS (klass);
|
||||
|
||||
gobject_class->finalize = g_unix_volume_monitor_finalize;
|
||||
gobject_class->dispose = g_unix_volume_monitor_dispose;
|
||||
|
||||
monitor_class->get_mounts = get_mounts;
|
||||
monitor_class->get_volumes = get_volumes;
|
||||
|
Reference in New Issue
Block a user