diff options
author | Ran Benita <ran234@gmail.com> | 2012-10-29 01:00:27 +0200 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2012-10-29 01:20:04 +0200 |
commit | 7261f404d201b157dc0ce1ae0386fd74f3a128a7 (patch) | |
tree | fbd0cf78ce7ace10dc1f79042163be0ab0b3528a /xkbcommon | |
parent | a51ee70419cf492a46020123294c7f708c81070d (diff) | |
download | libxkbcommon-7261f404d201b157dc0ce1ae0386fd74f3a128a7.tar.gz libxkbcommon-7261f404d201b157dc0ce1ae0386fd74f3a128a7.tar.bz2 libxkbcommon-7261f404d201b157dc0ce1ae0386fd74f3a128a7.zip |
state, context: allow passing NULL to *_unref()
For error handling code, it's nice to be able to pass NULL to these
function without worrying about segfaults ensuing. free() sets the
precedent here.
Also document this fact.
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'xkbcommon')
-rw-r--r-- | xkbcommon/xkbcommon.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/xkbcommon/xkbcommon.h b/xkbcommon/xkbcommon.h index fe5c789..65c4dcc 100644 --- a/xkbcommon/xkbcommon.h +++ b/xkbcommon/xkbcommon.h @@ -439,6 +439,8 @@ xkb_context_ref(struct xkb_context *context); /** * Release a reference on a context, and possibly free it. * + * @param context The context. If it is NULL, this function does nothing. + * * @memberof xkb_context */ void @@ -737,6 +739,8 @@ xkb_keymap_ref(struct xkb_keymap *keymap); /** * Release a reference on a keymap, and possibly free it. * + * @param keymap The keymap. If it is NULL, this function does nothing. + * * @memberof xkb_keymap */ void @@ -991,6 +995,8 @@ xkb_state_ref(struct xkb_state *state); /** * Release a reference on a keybaord state object, and possibly free it. * + * @param state The state. If it is NULL, this function does nothing. + * * @memberof xkb_state */ void |