summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-file-changes-queue.c
diff options
context:
space:
mode:
authorJasmine Hassan <jasmine.aura@gmail.com>2012-11-23 11:18:34 +0200
committerJasmine Hassan <jasmine.aura@gmail.com>2012-11-23 11:18:34 +0200
commitb00cccb74307a49df74deb785936e3cd9cf3a5ad (patch)
treef2bcc459a2bef12678e642d0a14ce7f02373b71d /libcaja-private/caja-file-changes-queue.c
parentb12a7f6ea3309ecddfc7e3ae839a7b558c862533 (diff)
downloadcaja-b00cccb74307a49df74deb785936e3cd9cf3a5ad.tar.bz2
caja-b00cccb74307a49df74deb785936e3cd9cf3a5ad.tar.xz
[all] include src/glibcompat.h & use g_list_free_full() where needed
Also fixes a double-free regression in lc-p/caja-query from 7a42b9b0
Diffstat (limited to 'libcaja-private/caja-file-changes-queue.c')
-rw-r--r--libcaja-private/caja-file-changes-queue.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/libcaja-private/caja-file-changes-queue.c b/libcaja-private/caja-file-changes-queue.c
index 39cf123e..43495c93 100644
--- a/libcaja-private/caja-file-changes-queue.c
+++ b/libcaja-private/caja-file-changes-queue.c
@@ -25,6 +25,8 @@
#include "caja-directory-notify.h"
+#include <src/glibcompat.h> /* for g_list_free_full */
+
#ifdef G_THREADS_ENABLED
#define MUTEX_LOCK(a) if ((a) != NULL) g_mutex_lock (a)
#define MUTEX_UNLOCK(a) if ((a) != NULL) g_mutex_unlock (a)
@@ -288,8 +290,7 @@ pairs_list_free (GList *pairs)
}
/* delete the list and the now empty pair structs */
- g_list_foreach(pairs, (GFunc) g_free, NULL);
- g_list_free(pairs);
+ g_list_free_full (pairs, g_free);
}
static void
@@ -304,8 +305,7 @@ position_set_list_free (GList *list)
g_object_unref (item->location);
}
/* delete the list and the now empty structs */
- g_list_foreach(list, (GFunc) g_free, NULL);
- g_list_free(list);
+ g_list_free_full (list, g_free);
}
/* go through changes in the change queue, send ones with the same kind
@@ -387,8 +387,7 @@ caja_file_changes_consume_changes (gboolean consume_all)
{
deletions = g_list_reverse (deletions);
caja_directory_notify_files_removed (deletions);
- g_list_foreach(deletions, (GFunc) g_object_unref, NULL);
- g_list_free(deletions);
+ g_list_free_full (deletions, g_object_unref);
deletions = NULL;
}
if (moves != NULL)
@@ -402,16 +401,14 @@ caja_file_changes_consume_changes (gboolean consume_all)
{
additions = g_list_reverse (additions);
caja_directory_notify_files_added (additions);
- g_list_foreach(additions, (GFunc) g_object_unref, NULL);
- g_list_free(additions);
+ g_list_free_full (additions, g_object_unref);
additions = NULL;
}
if (changes != NULL)
{
changes = g_list_reverse (changes);
caja_directory_notify_files_changed (changes);
- g_list_foreach(changes, (GFunc) g_object_unref, NULL);
- g_list_free(changes);
+ g_list_free_full (changes, g_object_unref);
changes = NULL;
}
if (position_set_requests != NULL)