diff options
author | Anders Broman <anders.broman@ericsson.com> | 2009-10-09 09:06:22 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2009-10-09 09:06:22 +0000 |
commit | 85d8b896a647411065e89fbd4d2289256fee6966 (patch) | |
tree | 29f474a752ee46b62f66c51a2872eafc0bd8b97c /gtk/hostlist_table.c | |
parent | b8755d930549daee0483e65ee95de860204608c8 (diff) |
From Didier Gautheron:
- memory leak, free the list after walking it, ie free a NULL list, ie free nothing. I've only fixed bugs introduced by me with GTKCList to TreeView modifs, it seems there's the same bug in gtk/dlg_utils.c.
svn path=/trunk/; revision=30421
Diffstat (limited to 'gtk/hostlist_table.c')
-rw-r--r-- | gtk/hostlist_table.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gtk/hostlist_table.c b/gtk/hostlist_table.c index 7c88634f6f..369731671c 100644 --- a/gtk/hostlist_table.c +++ b/gtk/hostlist_table.c @@ -535,9 +535,10 @@ draw_hostlist_table_data(hostlist_table *hl) guint j; if (host->address.type == AT_IPv4 && !hl->geoip_visible) { - GList *columns; + GList *columns, *list; GtkTreeViewColumn *column; columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(hl->table)); + list = columns; while(columns) { const gchar *title; gint id; @@ -550,7 +551,7 @@ draw_hostlist_table_data(hostlist_table *hl) } columns = g_list_next(columns); } - g_list_free(columns); + g_list_free(list); hl->geoip_visible = TRUE; } @@ -693,7 +694,7 @@ copy_as_csv_cb(GtkWindow *copy_bt, gpointer data _U_) { GtkClipboard *cb; char *savelocale; - GList *columns; + GList *columns, *list; GtkTreeViewColumn *column; GtkListStore *store; csv_t csv; @@ -707,6 +708,7 @@ copy_as_csv_cb(GtkWindow *copy_bt, gpointer data _U_) csv.CSV_str = g_string_new(""); columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(csv.talkers->table)); + list = columns; csv.nb_cols = 0; while(columns) { column = columns->data; @@ -719,7 +721,7 @@ copy_as_csv_cb(GtkWindow *copy_bt, gpointer data _U_) } columns = g_list_next(columns); } - g_list_free(columns); + g_list_free(list); g_string_append(csv.CSV_str,"\n"); store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(csv.talkers->table))); @@ -824,7 +826,7 @@ open_as_map_cb(GtkWindow *copy_bt, gpointer data _U_) char *map_path, *map_data_filename; char *src_file_path; char *dst_file_path; - GList *columns; + GList *columns, *list; GtkTreeViewColumn *column; GtkListStore *store; map_t map; @@ -837,6 +839,7 @@ open_as_map_cb(GtkWindow *copy_bt, gpointer data _U_) map.hosts_written = FALSE; /* Find the interesting columns */ columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(map.talkers->table)); + list = columns; map.nb_cols = 0; while(columns) { column = columns->data; @@ -874,7 +877,7 @@ open_as_map_cb(GtkWindow *copy_bt, gpointer data _U_) } columns = g_list_next(columns); } - g_list_free(columns); + g_list_free(list); /* check for the minimum required data */ if(map.col_lat == -1 || map.col_lon == -1) { |