summaryrefslogtreecommitdiff
path: root/src/caja-application.c
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-11-23 11:18:34 +0200
committerJasmine Hassan <[email protected]>2012-11-23 11:18:34 +0200
commitb00cccb74307a49df74deb785936e3cd9cf3a5ad (patch)
treef2bcc459a2bef12678e642d0a14ce7f02373b71d /src/caja-application.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 'src/caja-application.c')
-rw-r--r--src/caja-application.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/caja-application.c b/src/caja-application.c
index edba1d5c..6c68198f 100644
--- a/src/caja-application.c
+++ b/src/caja-application.c
@@ -75,6 +75,8 @@
#include <libcaja-extension/caja-menu-provider.h>
#include <libcaja-private/caja-autorun.h>
+#include "glibcompat.h" /* for g_list_free_full */
+
enum {
COMMAND_0, /* unused: 0 is an invalid command */
@@ -257,8 +259,7 @@ automount_all_volumes (CajaApplication *application)
/* pass NULL as GMountOperation to avoid user interaction */
g_volume_mount (volume, 0, NULL, NULL, startup_volume_mount_cb, NULL);
}
- g_list_foreach(volumes, (GFunc) g_object_unref, NULL);
- g_list_free(volumes);
+ g_list_free_full (volumes, g_object_unref);
}
}
@@ -761,8 +762,7 @@ finish_startup (CajaApplication *application,
/* listen for eject button presses */
drives = g_volume_monitor_get_connected_drives (application->volume_monitor);
g_list_foreach (drives, (GFunc) drive_listen_for_eject_button, application);
- g_list_foreach (drives, (GFunc) g_object_unref, NULL);
- g_list_free (drives);
+ g_list_free_full (drives, g_object_unref);
application->automount_idle_id =
g_idle_add_full (G_PRIORITY_LOW,
@@ -1171,9 +1171,7 @@ caja_application_close_desktop (void)
{
if (caja_application_desktop_windows != NULL)
{
- g_list_foreach (caja_application_desktop_windows,
- (GFunc) gtk_widget_destroy, NULL);
- g_list_free (caja_application_desktop_windows);
+ g_list_free_full (caja_application_desktop_windows, gtk_widget_destroy);
caja_application_desktop_windows = NULL;
}
}