summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-directory-async.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcaja-private/caja-directory-async.c')
-rw-r--r--libcaja-private/caja-directory-async.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/libcaja-private/caja-directory-async.c b/libcaja-private/caja-directory-async.c
index 9694b1b0..91a2ffb4 100644
--- a/libcaja-private/caja-directory-async.c
+++ b/libcaja-private/caja-directory-async.c
@@ -39,6 +39,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include <src/glibcompat.h> /* for g_list_free_full */
+
/* turn this on to see messages about each load_directory call: */
#if 0
#define DEBUG_LOAD_DIRECTORY
@@ -1079,8 +1081,7 @@ dequeue_pending_idle_callback (gpointer callback_data)
file->details->got_mime_list = TRUE;
file->details->mime_list_is_up_to_date = TRUE;
- g_list_foreach (file->details->mime_list, (GFunc) g_free, NULL);
- g_list_free(file->details->mime_list);
+ g_list_free_full (file->details->mime_list, g_free);
file->details->mime_list = istr_set_get_as_list
(dir_load_state->load_mime_list_hash);
@@ -1093,8 +1094,7 @@ dequeue_pending_idle_callback (gpointer callback_data)
}
drain:
- g_list_foreach (pending_file_info, (GFunc) g_object_unref, NULL);
- g_list_free(pending_file_info);
+ g_list_free_full (pending_file_info, g_object_unref);
/* Get the state machine running again. */
caja_directory_async_state_changed (directory);
@@ -1182,8 +1182,7 @@ file_list_cancel (CajaDirectory *directory)
if (directory->details->pending_file_info != NULL)
{
- g_list_foreach (directory->details->pending_file_info, (GFunc) g_object_unref, NULL);
- g_list_free(directory->details->pending_file_info);
+ g_list_free_full (directory->details->pending_file_info, g_object_unref);
directory->details->pending_file_info = NULL;
}
@@ -2788,8 +2787,7 @@ count_more_files_callback (GObject *source_object,
state);
}
- g_list_foreach (files, (GFunc) g_object_unref, NULL);
- g_list_free(files);
+ g_list_free_full (files, g_object_unref);
if (error)
{
@@ -3014,8 +3012,7 @@ deep_count_state_free (DeepCountState *state)
{
g_object_unref (state->deep_count_location);
}
- g_list_foreach (state->deep_count_subdirectories, (GFunc) g_object_unref, NULL);
- g_list_free(state->deep_count_subdirectories);
+ g_list_free_full (state->deep_count_subdirectories, g_object_unref);
g_array_free (state->seen_deep_count_inodes, TRUE);
g_free (state);
}
@@ -3323,8 +3320,7 @@ mime_list_done (MimeListState *state, gboolean success)
file = state->mime_list_file;
file->details->mime_list_is_up_to_date = TRUE;
- g_list_foreach(file->details->mime_list, (GFunc) g_free, NULL);
- g_list_free(file->details->mime_list);
+ g_list_free_full (file->details->mime_list, g_free);
if (success)
{
file->details->mime_list_failed = TRUE;
@@ -4579,8 +4575,7 @@ get_mount_at (GFile *target)
g_object_unref (root);
}
- g_list_foreach (mounts, (GFunc) g_object_unref, NULL);
- g_list_free(mounts);
+ g_list_free_full (mounts, g_object_unref);
g_object_unref (monitor);