g_object_unref (monitor->mount_monitor);
- g_list_foreach (monitor->last_mountpoints, (GFunc)g_unix_mount_point_free, NULL);
- g_list_free (monitor->last_mountpoints);
- g_list_foreach (monitor->last_mounts, (GFunc)g_unix_mount_free, NULL);
- g_list_free (monitor->last_mounts);
+ g_list_free_full (monitor->last_mountpoints, (GDestroyNotify) g_unix_mount_point_free);
+ g_list_free_full (monitor->last_mounts, (GDestroyNotify) g_unix_mount_free);
- g_list_foreach (monitor->volumes, (GFunc)g_object_unref, NULL);
- g_list_free (monitor->volumes);
- g_list_foreach (monitor->mounts, (GFunc)g_object_unref, NULL);
- g_list_free (monitor->mounts);
+ g_list_free_full (monitor->volumes, g_object_unref);
+ g_list_free_full (monitor->mounts, g_object_unref);
G_OBJECT_CLASS (g_unix_volume_monitor_parent_class)->finalize (object);
}
GUnixVolumeMonitor *monitor;
monitor = G_UNIX_VOLUME_MONITOR (object);
- g_list_foreach (monitor->volumes, (GFunc)g_object_unref, NULL);
- g_list_free (monitor->volumes);
+
+ g_list_free_full (monitor->volumes, g_object_unref);
monitor->volumes = NULL;
- g_list_foreach (monitor->mounts, (GFunc)g_object_unref, NULL);
- g_list_free (monitor->mounts);
+ g_list_free_full (monitor->mounts, g_object_unref);
monitor->mounts = NULL;
G_OBJECT_CLASS (g_unix_volume_monitor_parent_class)->dispose (object);
g_list_free (added);
g_list_free (removed);
- g_list_foreach (monitor->last_mountpoints,
- (GFunc)g_unix_mount_point_free, NULL);
- g_list_free (monitor->last_mountpoints);
+ g_list_free_full (monitor->last_mountpoints, (GDestroyNotify) g_unix_mount_point_free);
monitor->last_mountpoints = new_mountpoints;
}
g_list_free (added);
g_list_free (removed);
- g_list_foreach (monitor->last_mounts,
- (GFunc)g_unix_mount_free, NULL);
- g_list_free (monitor->last_mounts);
+ g_list_free_full (monitor->last_mounts, (GDestroyNotify) g_unix_mount_free);
monitor->last_mounts = new_mounts;
}