diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-06-14 19:15:37 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-06-14 19:15:37 +0800 |
commit | 9db42f6c20a456f5c910fe419cf23901deb98df3 (patch) | |
tree | ff837331b307b741e380810e17d48cc4a7eb8144 /embed/downloader-view.c | |
parent | a01ebeee69c4781df8b34f2928843417f58d2a15 (diff) | |
download | gsoc2013-epiphany-9db42f6c20a456f5c910fe419cf23901deb98df3.tar gsoc2013-epiphany-9db42f6c20a456f5c910fe419cf23901deb98df3.tar.gz gsoc2013-epiphany-9db42f6c20a456f5c910fe419cf23901deb98df3.tar.bz2 gsoc2013-epiphany-9db42f6c20a456f5c910fe419cf23901deb98df3.tar.lz gsoc2013-epiphany-9db42f6c20a456f5c910fe419cf23901deb98df3.tar.xz gsoc2013-epiphany-9db42f6c20a456f5c910fe419cf23901deb98df3.tar.zst gsoc2013-epiphany-9db42f6c20a456f5c910fe419cf23901deb98df3.zip |
Use g_list_prepend instead of g_list_append, and fix mem leaks along the
2003-06-14 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-topic-action.c: (build_bookmarks_menu),
(build_topics_menu):
* src/language-dialog.c: (language_editor_remove_button_clicked_cb):
* src/pdm-dialog.c: (pdm_dialog_remove_button_clicked_cb):
* embed/downloader-view.c: (download_dialog_abort_cb):
Use g_list_prepend instead of g_list_append, and fix mem leaks
along the way.
Diffstat (limited to 'embed/downloader-view.c')
-rw-r--r-- | embed/downloader-view.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/embed/downloader-view.c b/embed/downloader-view.c index 390fd98d5..34e8275da 100644 --- a/embed/downloader-view.c +++ b/embed/downloader-view.c @@ -853,19 +853,19 @@ download_dialog_pause_cb (GtkButton *button, DownloaderView *dv) void download_dialog_abort_cb (GtkButton *button, DownloaderView *dv) { - GList *l, *r = NULL; + GList *llist, *rlist = NULL, *l, *r; GtkTreeSelection *selection; GtkTreeModel *model; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(dv->priv->treeview)); - l = gtk_tree_selection_get_selected_rows (selection, &model); - for (;l != NULL; l = l->next) + llist = gtk_tree_selection_get_selected_rows (selection, &model); + for (l = llist;l != NULL; l = l->next) { - r = g_list_append (r, gtk_tree_row_reference_new - (model, (GtkTreePath *)l->data)); + rlist = g_list_prepend (rlist, gtk_tree_row_reference_new + (model, (GtkTreePath *)l->data)); } - for (; r != NULL; r = g_list_next (r)) + for (r = rlist; r != NULL; r = r->next) { GtkTreeRowReference *node = r->data; GValue val = {0, }; @@ -891,10 +891,9 @@ download_dialog_abort_cb (GtkButton *button, DownloaderView *dv) gtk_tree_row_reference_free (node); } - l = g_list_first (l); - g_list_foreach (l, (GFunc)gtk_tree_path_free, NULL); - g_list_free (l); - g_list_free (r); + g_list_foreach (llist, (GFunc)gtk_tree_path_free, NULL); + g_list_free (llist); + g_list_free (rlist); } static void |