mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 10:18:03 +02:00
glib-aux: add nm_g_bytes_ref() helper
g_bytes_ref() does not accept NULL. But doing so can be convenient, add a helper for that. Note that g_bytes_unref() does accept NULL, so there is no corresponding helper. (cherry picked from commit222f404928) (cherry picked from commit01bcde8ab0)
This commit is contained in:
parent
bbd902cb9a
commit
d4b1dff1eb
1 changed files with 10 additions and 0 deletions
|
|
@ -623,6 +623,16 @@ nm_utils_is_separator(const char c)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
static inline GBytes *
|
||||
nm_g_bytes_ref(GBytes *b)
|
||||
{
|
||||
if (b)
|
||||
g_bytes_ref(b);
|
||||
return b;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
GBytes *nm_g_bytes_get_empty(void);
|
||||
|
||||
GBytes *nm_g_bytes_new_from_str(const char *str);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue