diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2013-01-17 11:57:43 +0100 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2013-01-17 11:57:43 +0100 |
commit | fd135fe90ce9b9a568468c4ddb21e6d13135e80d (patch) | |
tree | 77a3a34834640f00797fb8b5e072b7356706231e /daemon | |
parent | 85e2ef5741bc0e165e6e74a70917bd7f0390444f (diff) | |
download | gvfs-fd135fe90ce9b9a568468c4ddb21e6d13135e80d.tar.gz |
Use g_list_free_full() where applicable
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gvfsbackendarchive.c | 3 | ||||
-rw-r--r-- | daemon/gvfsbackendcdda.c | 6 | ||||
-rw-r--r-- | daemon/gvfsbackendcomputer.c | 3 | ||||
-rw-r--r-- | daemon/gvfsbackenddnssd.c | 2 | ||||
-rw-r--r-- | daemon/gvfsbackendftp.c | 3 | ||||
-rw-r--r-- | daemon/gvfsbackendgphoto2.c | 15 | ||||
-rw-r--r-- | daemon/gvfsbackendobexftp-cap-parser.c | 5 | ||||
-rw-r--r-- | daemon/gvfsbackendobexftp-fl-parser.c | 3 | ||||
-rw-r--r-- | daemon/gvfsbackendobexftp.c | 9 | ||||
-rw-r--r-- | daemon/gvfsbackendsmb.c | 3 | ||||
-rw-r--r-- | daemon/gvfsbackendsmbbrowse.c | 9 | ||||
-rw-r--r-- | daemon/mount.c | 3 |
12 files changed, 21 insertions, 43 deletions
diff --git a/daemon/gvfsbackendarchive.c b/daemon/gvfsbackendarchive.c index 30b44557..1babced7 100644 --- a/daemon/gvfsbackendarchive.c +++ b/daemon/gvfsbackendarchive.c @@ -513,8 +513,7 @@ create_file_tree (GVfsBackendArchive *ba, GVfsJob *job) static void archive_file_free (ArchiveFile *file) { - g_slist_foreach (file->children, (GFunc) archive_file_free, NULL); - g_slist_free (file->children); + g_slist_free_full (file->children, (GDestroyNotify) archive_file_free); if (file->info) g_object_unref (file->info); g_free (file->name); diff --git a/daemon/gvfsbackendcdda.c b/daemon/gvfsbackendcdda.c index 837d103a..88f70fb4 100644 --- a/daemon/gvfsbackendcdda.c +++ b/daemon/gvfsbackendcdda.c @@ -150,8 +150,7 @@ release_metadata (GVfsBackendCdda *cdda_backend) cdda_backend->album_artist = NULL; g_free (cdda_backend->genre); cdda_backend->genre = NULL; - g_list_foreach (cdda_backend->tracks, (GFunc) track_free, NULL); - g_list_free (cdda_backend->tracks); + g_list_free_full (cdda_backend->tracks, (GDestroyNotify) track_free); cdda_backend->tracks = NULL; } @@ -1066,8 +1065,7 @@ do_enumerate (GVfsBackend *backend, g_vfs_job_succeeded (G_VFS_JOB (job)); g_vfs_job_enumerate_add_infos (job, l); - g_list_foreach (l, (GFunc) g_object_unref, NULL); - g_list_free (l); + g_list_free_full (l, g_object_unref); g_vfs_job_enumerate_done (job); } diff --git a/daemon/gvfsbackendcomputer.c b/daemon/gvfsbackendcomputer.c index e79454f9..a5879e79 100644 --- a/daemon/gvfsbackendcomputer.c +++ b/daemon/gvfsbackendcomputer.c @@ -889,8 +889,7 @@ mount_volume_from_drive (GDrive *drive, _("Can't mount file")); } - g_list_foreach (volumes, (GFunc)g_object_unref, NULL); - g_list_free (volumes); + g_list_free_full (volumes, g_object_unref); } static void diff --git a/daemon/gvfsbackenddnssd.c b/daemon/gvfsbackenddnssd.c index 8198604b..366b299a 100644 --- a/daemon/gvfsbackenddnssd.c +++ b/daemon/gvfsbackenddnssd.c @@ -800,7 +800,7 @@ g_vfs_backend_dns_sd_finalize (GObject *object) g_free (backend->domain); - g_list_foreach (backend->files, (GFunc)link_file_free, NULL); + g_list_free_full (backend->files, (GDestroyNotify)link_file_free); if (G_OBJECT_CLASS (g_vfs_backend_dns_sd_parent_class)->finalize) (*G_OBJECT_CLASS (g_vfs_backend_dns_sd_parent_class)->finalize) (object); diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c index c55640e9..8edb448c 100644 --- a/daemon/gvfsbackendftp.c +++ b/daemon/gvfsbackendftp.c @@ -1269,8 +1269,7 @@ do_delete (GVfsBackend *backend, G_IO_ERROR, G_IO_ERROR_NOT_EMPTY, g_strerror (ENOTEMPTY)); - g_list_foreach (list, (GFunc) g_object_unref, NULL); - g_list_free (list); + g_list_free_full (list, g_object_unref); } else { diff --git a/daemon/gvfsbackendgphoto2.c b/daemon/gvfsbackendgphoto2.c index 0bf346a1..19f3c34a 100644 --- a/daemon/gvfsbackendgphoto2.c +++ b/daemon/gvfsbackendgphoto2.c @@ -2227,8 +2227,7 @@ do_enumerate (GVfsBackend *backend, { g_vfs_job_failed_from_error (G_VFS_JOB (job), error); g_error_free (error); - g_list_foreach (l, (GFunc) g_object_unref, NULL); - g_list_free (l); + g_list_free_full (l, g_object_unref); gp_list_free (list); return; } @@ -2294,8 +2293,7 @@ do_enumerate (GVfsBackend *backend, { g_vfs_job_failed_from_error (G_VFS_JOB (job), error); g_error_free (error); - g_list_foreach (l, (GFunc) g_object_unref, NULL); - g_list_free (l); + g_list_free_full (l, g_object_unref); gp_list_free (list); return; } @@ -2320,8 +2318,7 @@ do_enumerate (GVfsBackend *backend, g_vfs_job_succeeded (G_VFS_JOB (job)); g_vfs_job_enumerate_add_infos (job, l); - g_list_foreach (l, (GFunc) g_object_unref, NULL); - g_list_free (l); + g_list_free_full (l, g_object_unref); g_vfs_job_enumerate_done (job); g_free (filename); @@ -2411,8 +2408,7 @@ try_enumerate (GVfsBackend *backend, g_vfs_job_succeeded (G_VFS_JOB (job)); g_vfs_job_enumerate_add_infos (job, l); - g_list_foreach (l, (GFunc) g_object_unref, NULL); - g_list_free (l); + g_list_free_full (l, g_object_unref); g_vfs_job_enumerate_done (job); g_free (filename); @@ -2420,8 +2416,7 @@ try_enumerate (GVfsBackend *backend, return TRUE; error_not_cached: - g_list_foreach (l, (GFunc) g_object_unref, NULL); - g_list_free (l); + g_list_free_full (l, g_object_unref); g_free (filename); DEBUG (" BUU no info from cache for try_enumerate (%s)", given_filename); diff --git a/daemon/gvfsbackendobexftp-cap-parser.c b/daemon/gvfsbackendobexftp-cap-parser.c index 804467d3..4629930a 100644 --- a/daemon/gvfsbackendobexftp-cap-parser.c +++ b/daemon/gvfsbackendobexftp-cap-parser.c @@ -523,10 +523,7 @@ ovu_caps_memory_equal (OvuCapsMemory *m1, OvuCapsMemory *m2) void ovu_caps_free (OvuCaps *caps) { - g_list_foreach (caps->memory_entries, - (GFunc) ovu_caps_memory_free, NULL); - - g_list_free (caps->memory_entries); + g_list_free_full (caps->memory_entries, (GDestroyNotify) ovu_caps_memory_free); g_free (caps); } diff --git a/daemon/gvfsbackendobexftp-fl-parser.c b/daemon/gvfsbackendobexftp-fl-parser.c index 5aca2ad8..5e97a91e 100644 --- a/daemon/gvfsbackendobexftp-fl-parser.c +++ b/daemon/gvfsbackendobexftp-fl-parser.c @@ -350,8 +350,7 @@ static void fl_parser_free_parser_data (ParserData *data, gboolean free_list) { if (free_list) { - g_list_foreach (data->elements, (GFunc) g_object_unref, NULL); - g_list_free (data->elements); + g_list_free_full (data->elements, g_object_unref); data->elements = NULL; } diff --git a/daemon/gvfsbackendobexftp.c b/daemon/gvfsbackendobexftp.c index 69e32673..242250cf 100644 --- a/daemon/gvfsbackendobexftp.c +++ b/daemon/gvfsbackendobexftp.c @@ -752,8 +752,7 @@ _query_file_info_helper (GVfsBackend *backend, } g_free (basename); - g_list_foreach (elements, (GFunc)g_object_unref, NULL); - g_list_free (elements); + g_list_free_full (elements, g_object_unref); g_debug ("- _query_file_info_helper\n"); @@ -1547,8 +1546,7 @@ do_enumerate (GVfsBackend *backend, g_vfs_job_enumerate_add_infos (job, elements); - g_list_foreach (elements, (GFunc)g_object_unref, NULL); - g_list_free (elements); + g_list_free_full (elements, g_object_unref); g_vfs_job_enumerate_done (job); g_mutex_unlock (&op_backend->mutex); @@ -1972,8 +1970,7 @@ do_delete (GVfsBackend *backend, g_free (files); len = g_list_length (elements); - g_list_foreach (elements, (GFunc)g_object_unref, NULL); - g_list_free (elements); + g_list_free_full (elements, g_object_unref); if (len != 0) { diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c index f69bc1b5..0f6f089b 100644 --- a/daemon/gvfsbackendsmb.c +++ b/daemon/gvfsbackendsmb.c @@ -1888,8 +1888,7 @@ do_enumerate (GVfsBackend *backend, { files = g_list_reverse (files); g_vfs_job_enumerate_add_infos (job, files); - g_list_foreach (files, (GFunc)g_object_unref, NULL); - g_list_free (files); + g_list_free_full (files, g_object_unref); } } diff --git a/daemon/gvfsbackendsmbbrowse.c b/daemon/gvfsbackendsmbbrowse.c index f216fa62..46bbc945 100644 --- a/daemon/gvfsbackendsmbbrowse.c +++ b/daemon/gvfsbackendsmbbrowse.c @@ -231,8 +231,7 @@ g_vfs_backend_smb_browse_finalize (GObject *object) smbc_free_context (backend->smb_context, TRUE); - g_list_foreach (backend->entries, (GFunc)browse_entry_free, NULL); - g_list_free (backend->entries); + g_list_free_full (backend->entries, (GDestroyNotify)browse_entry_free); if (G_OBJECT_CLASS (g_vfs_backend_smb_browse_parent_class)->finalize) (*G_OBJECT_CLASS (g_vfs_backend_smb_browse_parent_class)->finalize) (object); @@ -668,8 +667,7 @@ update_cache (GVfsBackendSmbBrowse *backend, SMBCFILE *supplied_dir) g_mutex_lock (&backend->entries_lock); /* Clear old cache */ - g_list_foreach (backend->entries, (GFunc)browse_entry_free, NULL); - g_list_free (backend->entries); + g_list_free_full (backend->entries, (GDestroyNotify)browse_entry_free); backend->entries = entries; backend->entry_errno = entry_errno; backend->last_entry_update = time (NULL); @@ -1447,8 +1445,7 @@ run_enumerate (GVfsBackendSmbBrowse *backend, files = g_list_reverse (files); g_vfs_job_enumerate_add_infos (job, files); - g_list_foreach (files, (GFunc)g_object_unref, NULL); - g_list_free (files); + g_list_free_full (files, g_object_unref); g_vfs_job_enumerate_done (job); } diff --git a/daemon/mount.c b/daemon/mount.c index 5224a664..d1341f56 100644 --- a/daemon/mount.c +++ b/daemon/mount.c @@ -547,8 +547,7 @@ read_mountable_config (void) static void re_read_mountable_config (void) { - g_list_foreach (mountables, (GFunc)vfs_mountable_free, NULL); - g_list_free (mountables); + g_list_free_full (mountables, (GDestroyNotify)vfs_mountable_free); mountables = NULL; read_mountable_config (); |