summaryrefslogtreecommitdiff
path: root/components/help/converters
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-09-23 01:21:29 +0000
committerDarin Adler <darin@src.gnome.org>2000-09-23 01:21:29 +0000
commitcbf7c584a49fda3d557657fc10e5ef80c8e89a6a (patch)
tree617ee74b940187855103d8a61db1b0a46584cb48 /components/help/converters
parentbb556e5bdbc2b718340f76575ed6b3100c23e570 (diff)
downloadnautilus-cbf7c584a49fda3d557657fc10e5ef80c8e89a6a.tar.gz
Storage leak fixes. Today I concentrated on leaks that happen
when you change views from Icon to List View and back. * components/tree/nautilus-tree-view.c: (nautilus_tree_view_insert_model_node): Unref a pixmap and bitmap, free a string. (nautilus_tree_view_update_model_node): Unref a pixmap and bitmap, free a string. (notify_node_seen): Free a string. (nautilus_tree_view_uri_to_name): Removed extra g_strdup. * libnautilus-extensions/nautilus-glib-extensions.c: (free_hash_tables_at_exit): Free a list. * libnautilus-extensions/nautilus-list.c: (draw_cell): Skip the excess work of re-getting the pixmap and bitmap, not using them, and leaking them. * libnautilus-extensions/nautilus-preferences.c: (preferences_hash_node_remove_callback): Free a list. * src/file-manager/fm-directory-view.c: (queue_pending_files): Free a list. * src/file-manager/fm-icon-view.c: (get_icon_text_callback): Free a string in all code paths (was freed in some before). * src/file-manager/fm-list-view.c: (add_to_list): Free the column text in a way that works even though some columns have NULL. (install_row_images): Unref a pixmap and bitmap. * libnautilus-extensions/nautilus-scalable-font.c: (destroy_global_rsvg_ft_context), (initialize_global_stuff_if_needed): Free the rsvg_ft font cache at exit. * libnautilus-extensions/nautilus-theme.c: (free_last_theme), (nautilus_theme_get_theme_data): Free the cached theme XML document at exit. * components/help/converters/gnome-db2html2/gdb3html.c: (remove_head), (start_element), (end_element), (cdata_block): * components/tree/nautilus-tree-model.c: (nautilus_tree_model_for_each_postorder), (nautilus_tree_model_monitor_add): * libnautilus-extensions/nautilus-directory-async.c: (remove_monitor_link), (dequeue_pending_idle_callback), (remove_callback_link_keep_data), (remove_callback_link): * libnautilus-extensions/nautilus-drag.c: (nautilus_drag_file_receive_dropped_keyword): * libnautilus-extensions/nautilus-file-changes-queue.c: (nautilus_file_changes_queue_get_change): * libnautilus-extensions/nautilus-thumbnails.c: (check_for_thumbnails): * src/file-manager/fm-properties-window.c: (property_button_toggled): * src/nautilus-window-manage-views.c: (handle_go_back), (handle_go_forward): * src/nautilus-window.c: (nautilus_add_to_history_list): Fixed a bunch of callers of g_list_remove_link to also free the removed link. This seems to be an error-prone API from glib. About half of the callers had it wrong. * src/nautilus-bookmark-list.c: (nautilus_bookmark_list_delete_item_at), (nautilus_bookmark_list_delete_items_with_uri): * src/nautilus-sidebar.c: (receive_dropped_keyword): Changed to use g_list_free_1 for clarity. * src/nautilus-location-bar.c: Coding style tweaks. * src/nautilus-main.c: (main): Run the self-checks a second time if they succeed the first time. More thorough check this way (make sure the test works even after it's been run once), and better to notice one-time vs. per-test leaks. * tools/leak-checker/nautilus-leak-checker.c: (g_slist_alloc), (g_slist_free), (g_slist_free_1), (g_mem_chunk_new), (g_mem_chunk_destroy), (g_mem_chunk_alloc), (g_mem_chunk_alloc0), (g_mem_chunk_free), (g_mem_chunk_clean), (g_mem_chunk_reset), (g_mem_chunk_print): Made the GSList and GMemChunk code dumb down when using the leak checker. * tools/leak-checker/nautilus-leak-checker.c: Added more symbols of "known to leak" functions so we can see the real leakers.
Diffstat (limited to 'components/help/converters')
-rw-r--r--components/help/converters/gnome-db2html2/gdb3html.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/components/help/converters/gnome-db2html2/gdb3html.c b/components/help/converters/gnome-db2html2/gdb3html.c
index 297acea13..d9411af4c 100644
--- a/components/help/converters/gnome-db2html2/gdb3html.c
+++ b/components/help/converters/gnome-db2html2/gdb3html.c
@@ -1,3 +1,5 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+
#include <config.h>
#include "gdb3html.h"
@@ -222,6 +224,17 @@ end_document (Context *context)
endDocument (context->ParserCtxt);
}
+static GList *
+remove_head (GList *list)
+{
+ GList *head;
+
+ head = list;
+ list = g_list_remove_link (list, head);
+ g_list_free_1 (head);
+ return list;
+}
+
static void
start_element(Context *context,
const gchar *name,
@@ -241,9 +254,9 @@ start_element(Context *context,
if (element && element->start_element_func)
(* element->start_element_func) (context, name, attrs);
if (!g_strcasecmp (name, "xref")) {
- context->stack = g_list_remove_link (context->stack, context->stack);
+ context->stack = remove_head (context->stack);
} else if (!g_strcasecmp (name, "void")) {
- context->stack = g_list_remove_link (context->stack, context->stack);
+ context->stack = remove_head (context->stack);
}
}
@@ -266,7 +279,7 @@ end_element (Context *context,
if (element && element->end_element_func)
(* element->end_element_func) (context, name);
- context->stack = g_list_remove_link (context->stack, context->stack);
+ context->stack = remove_head (context->stack);
atrs_ptr = stack_el->atrs;
while (atrs_ptr && *atrs_ptr) {
@@ -355,7 +368,7 @@ cdata_block (Context *context, const xmlChar *value, int len)
if (element && element->characters_func)
(* element->characters_func) (context, value, len);
- context->stack = g_list_remove_link (context->stack, context->stack);
+ context->stack = remove_head (context->stack);
}
static int