diff options
author | Ran Benita <ran234@gmail.com> | 2012-03-01 20:41:34 +0200 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2012-03-04 00:04:04 +0200 |
commit | 19e99bb27a8ab4121aa28124db4d26ba6de73f47 (patch) | |
tree | 0bde29caf41c7cd7c0330ca12af9f9c9674de25c /src/atom.c | |
parent | d94d9b45223b3f99c8b75d634f486a5a56918d05 (diff) | |
download | xorg-lib-libxkbcommon-19e99bb27a8ab4121aa28124db4d26ba6de73f47.tar.gz |
Free all atoms along with keymap
The code to do this is taken from xserver, dix/atom.c.
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/atom.c')
-rw-r--r-- | src/atom.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -215,3 +215,26 @@ xkb_intern_atom(const char *string) else return None; } + +static void +FreeAtom(NodePtr patom) +{ + if (patom->left) + FreeAtom(patom->left); + if (patom->right) + FreeAtom(patom->right); + free(patom->string); + free(patom); +} + +void +XkbcFreeAllAtoms(void) +{ + if (atomRoot == NULL) + return; + FreeAtom(atomRoot); + atomRoot = NULL; + free(nodeTable); + nodeTable = NULL; + lastAtom = None; +} |