list, slist: Add g_clear_{s,}list()

Although not quite as often-occurring, this should help with constructs
like this:

  if (list)
    {
      g_list_free_full (list, foo);
      list = NULL;
    }

Closes https://gitlab.gnome.org/GNOME/glib/issues/1943
This commit is contained in:
Ernestas Kulik
2019-11-23 17:41:54 +01:00
parent 8555aeec8d
commit 58ba7d78fb
6 changed files with 152 additions and 0 deletions

View File

@@ -2503,6 +2503,7 @@ g_list_delete_link
g_list_remove_all
g_list_free
g_list_free_full
g_clear_list
<SUBSECTION>
g_list_alloc
@@ -2559,6 +2560,7 @@ g_slist_free
g_slist_free_full
g_slist_free_1
g_slist_free1
g_clear_slist
<SUBSECTION>
g_slist_length