qulogic/libgnt

Use g_list_free_full.

2019-04-04, Elliott Sales de Andrade
8b630a6c549d
Parents e53045dbed62
Children eb560e360258
Use g_list_free_full.
  • +1 -2
    gntbindable.c
  • +1 -2
    gntbox.c
  • +1 -2
    gntcombobox.c
  • +3 -6
    gntentry.c
  • +3 -6
    gntfilesel.c
  • +1 -2
    gntmenu.c
  • +1 -2
    gnttree.c
  • +1 -2
    gntwm.c
  • --- a/gntbindable.c Fri Apr 05 23:40:03 2019 +0000
    +++ b/gntbindable.c Thu Apr 04 19:09:27 2019 -0400
    @@ -141,8 +141,7 @@
    rebind_info.params = NULL;
    - g_list_foreach(current_row_data, (GFunc)g_free, NULL);
    - g_list_free(current_row_data);
    + g_list_free_full(current_row_data, g_free);
    gnt_box_set_alignment(GNT_BOX(vbox), GNT_ALIGN_MID);
    --- a/gntbox.c Fri Apr 05 23:40:03 2019 +0000
    +++ b/gntbox.c Thu Apr 04 19:09:27 2019 -0400
    @@ -777,8 +777,7 @@
    void gnt_box_remove_all(GntBox *box)
    {
    - g_list_foreach(box->list, (GFunc)gnt_widget_destroy, NULL);
    - g_list_free(box->list);
    + g_list_free_full(box->list, (GDestroyNotify)gnt_widget_destroy);
    g_list_free(box->focus);
    box->list = NULL;
    box->focus = NULL;
    --- a/gntcombobox.c Fri Apr 05 23:40:03 2019 +0000
    +++ b/gntcombobox.c Thu Apr 04 19:09:27 2019 -0400
    @@ -182,8 +182,7 @@
    GList *list = gnt_tree_get_row_text_list(tree, key); \
    gboolean found = FALSE; \
    found = (list->data && g_ascii_strncasecmp(text, list->data, len) == 0); \
    - g_list_foreach(list, (GFunc)g_free, NULL); \
    - g_list_free(list); \
    + g_list_free_full(list, g_free); \
    if (found) { \
    if (!showing) \
    popup_dropdown(box); \
    --- a/gntentry.c Fri Apr 05 23:40:03 2019 +0000
    +++ b/gntentry.c Thu Apr 04 19:09:27 2019 -0400
    @@ -890,14 +890,12 @@
    if (entry->history)
    {
    entry->history = g_list_first(entry->history);
    - g_list_foreach(entry->history, (GFunc)g_free, NULL);
    - g_list_free(entry->history);
    + g_list_free_full(entry->history, g_free);
    }
    if (entry->suggests)
    {
    - g_list_foreach(entry->suggests, (GFunc)g_free, NULL);
    - g_list_free(entry->suggests);
    + g_list_free_full(entry->suggests, g_free);
    }
    if (entry->ddown)
    @@ -1174,8 +1172,7 @@
    if (entry->history)
    {
    entry->history = g_list_first(entry->history);
    - g_list_foreach(entry->history, (GFunc)g_free, NULL);
    - g_list_free(entry->history);
    + g_list_free_full(entry->history, g_free);
    entry->history = NULL;
    }
    return;
    --- a/gntfilesel.c Fri Apr 05 23:40:03 2019 +0000
    +++ b/gntfilesel.c Thu Apr 04 19:09:27 2019 -0400
    @@ -59,8 +59,7 @@
    g_free(sel->current);
    g_free(sel->suggest);
    if (sel->tags) {
    - g_list_foreach(sel->tags, (GFunc)g_free, NULL);
    - g_list_free(sel->tags);
    + g_list_free_full(sel->tags, g_free);
    }
    }
    @@ -240,8 +239,7 @@
    gnt_tree_set_row_flags(GNT_TREE(sel->files), (gpointer)str, GNT_TEXT_FLAG_BOLD);
    }
    }
    - g_list_foreach(files, (GFunc)gnt_file_free, NULL);
    - g_list_free(files);
    + g_list_free_full(files, (GDestroyNotify)gnt_file_free);
    if (GNT_WIDGET_IS_FLAG_SET(GNT_WIDGET(sel), GNT_WIDGET_MAPPED))
    gnt_widget_draw(GNT_WIDGET(sel));
    return TRUE;
    @@ -408,8 +406,7 @@
    gnt_tree_is_searching(GNT_TREE(tree)))
    return FALSE;
    - g_list_foreach(sel->tags, (GFunc)g_free, NULL);
    - g_list_free(sel->tags);
    + g_list_free_full(sel->tags, g_free);
    sel->tags = NULL;
    for (iter = GNT_TREE(tree)->list; iter; iter = iter->next)
    --- a/gntmenu.c Fri Apr 05 23:40:03 2019 +0000
    +++ b/gntmenu.c Thu Apr 04 19:09:27 2019 -0400
    @@ -369,8 +369,7 @@
    gnt_menu_destroy(GntWidget *widget)
    {
    GntMenu *menu = GNT_MENU(widget);
    - g_list_foreach(menu->list, (GFunc)g_object_unref, NULL);
    - g_list_free(menu->list);
    + g_list_free_full(menu->list, g_object_unref);
    org_destroy(widget);
    }
    --- a/gnttree.c Fri Apr 05 23:40:03 2019 +0000
    +++ b/gnttree.c Thu Apr 04 19:09:27 2019 -0400
    @@ -1160,8 +1160,7 @@
    if (!row)
    return;
    - g_list_foreach(row->columns, (GFunc)free_tree_col, NULL);
    - g_list_free(row->columns);
    + g_list_free_full(row->columns, free_tree_col);
    g_free(row);
    }
    --- a/gntwm.c Fri Apr 05 23:40:03 2019 +0000
    +++ b/gntwm.c Thu Apr 04 19:09:27 2019 -0400
    @@ -1382,8 +1382,7 @@
    GntWM *wm = GNT_WM(obj);
    GList *list = NULL;
    g_hash_table_foreach(wm->nodes, accumulate_windows, &list);
    - g_list_foreach(list, (GFunc)gnt_widget_destroy, NULL);
    - g_list_free(list);
    + g_list_free_full(list, (GDestroyNotify)gnt_widget_destroy);
    g_hash_table_destroy(wm->nodes);
    wm->nodes = NULL;