shared: add nm_g_array_unref() helper

This commit is contained in:
Thomas Haller 2020-11-06 16:40:24 +01:00
parent 0cf4250021
commit f4d472beab
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -1538,6 +1538,13 @@ nm_g_array_len(const GArray *arr)
return arr ? arr->len : 0u;
}
static inline void
nm_g_array_unref(GArray *arr)
{
if (arr)
g_array_unref(arr);
}
#define nm_g_array_append_new(arr, type) \
({ \
GArray *const _arr = (arr); \