diff options
author | Thomas Haller <thaller@redhat.com> | 2019-06-30 10:31:03 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-07-02 17:52:53 +0200 |
commit | 7c84227c93b0fdb3e47791308d30907fdd5c7ed6 (patch) | |
tree | c47af0b7f81e3e236cca85ce8e63b504ae7e8aa9 /shared/nm-glib-aux | |
parent | 26317ec7e30753c9b0f2db7eabe236b39af4aa13 (diff) | |
download | NetworkManager-7c84227c93b0fdb3e47791308d30907fdd5c7ed6.tar.gz |
shared: add nm_c_list_elem_free_steal() util
Diffstat (limited to 'shared/nm-glib-aux')
-rw-r--r-- | shared/nm-glib-aux/nm-c-list.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/shared/nm-glib-aux/nm-c-list.h b/shared/nm-glib-aux/nm-c-list.h index 96b0279469..7512730d81 100644 --- a/shared/nm-glib-aux/nm-c-list.h +++ b/shared/nm-glib-aux/nm-c-list.h @@ -67,6 +67,18 @@ nm_c_list_elem_free (NMCListElem *elem) return nm_c_list_elem_free_full (elem, NULL); } +static inline void * +nm_c_list_elem_free_steal (NMCListElem *elem) +{ + gpointer data; + + if (!elem) + return NULL; + data = elem->data; + nm_c_list_elem_free_full (elem, NULL); + return data; +} + static inline void nm_c_list_elem_free_all (CList *head, GDestroyNotify free_fcn) { |