summaryrefslogtreecommitdiff
path: root/src/caja-window-manage-views.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-window-manage-views.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-window-manage-views.c')
-rw-r--r--src/caja-window-manage-views.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/caja-window-manage-views.c b/src/caja-window-manage-views.c
index 5156cb18..117412c8 100644
--- a/src/caja-window-manage-views.c
+++ b/src/caja-window-manage-views.c
@@ -74,6 +74,8 @@
*/
#include "caja-desktop-window.h"
+#include "glibcompat.h" /* for g_list_free_full */
+
/* This number controls a maximum character count for a URL that is
* displayed as part of a dialog. It's fairly arbitrary -- big enough
* to allow most "normal" URIs to display in full, but small enough to
@@ -1421,8 +1423,7 @@ create_content_view (CajaWindowSlot *slot,
FALSE,
TRUE);
- g_list_foreach(slot->pending_selection, (GFunc) g_object_unref, NULL);
- g_list_free(slot->pending_selection);
+ g_list_free_full (slot->pending_selection, g_object_unref);
slot->pending_selection = NULL;
}
else if (slot->location != NULL)
@@ -1433,8 +1434,7 @@ create_content_view (CajaWindowSlot *slot,
selection,
FALSE,
TRUE);
- g_list_foreach(selection, (GFunc) g_object_unref, NULL);
- g_list_free(selection);
+ g_list_free_full (selection, g_object_unref);
}
else
{
@@ -1492,8 +1492,7 @@ load_new_location (CajaWindowSlot *slot,
caja_view_set_selection (view, selection_copy);
}
- g_list_foreach(selection_copy, (GFunc) g_object_unref, NULL);
- g_list_free(selection_copy);
+ g_list_free_full (selection_copy, g_object_unref);
}
/* A view started to load the location its viewing, either due to
@@ -1950,8 +1949,7 @@ free_location_change (CajaWindowSlot *slot)
}
slot->pending_location = NULL;
- g_list_foreach(slot->pending_selection, (GFunc) g_object_unref, NULL);
- g_list_free(slot->pending_selection);
+ g_list_free_full (slot->pending_selection, g_object_unref);
slot->pending_selection = NULL;
/* Don't free pending_scroll_to, since thats needed until
@@ -2005,8 +2003,7 @@ cancel_location_change (CajaWindowSlot *slot)
selection,
TRUE,
FALSE);
- g_list_foreach(selection, (GFunc) g_object_unref, NULL);
- g_list_free(selection);
+ g_list_free_full (selection, g_object_unref);
}
end_location_change (slot);
@@ -2356,8 +2353,7 @@ caja_window_slot_reload (CajaWindowSlot *slot)
NULL, NULL);
g_free (current_pos);
g_object_unref (location);
- g_list_foreach(selection, (GFunc) g_object_unref, NULL);
- g_list_free(selection);
+ g_list_free_full (selection, g_object_unref);
}
void