The code to do this is taken from xserver, dix/atom.c.
Signed-off-by: Ran Benita <ran234@gmail.com>
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;
+}
#include "xkballoc.h"
#include "xkbrules.h"
#include "xkbpath.h"
+#include "xkbmisc.h"
#include "parseutils.h"
#include "utils.h"
xkb_free_keymap(struct xkb_desc *xkb)
{
XkbcFreeKeyboard(xkb);
+ XkbcFreeAllAtoms();
}
extern char *
XkbcAtomGetString(uint32_t atom);
+extern void
+XkbcFreeAllAtoms(void);
+
/***====================================================================***/
extern const char *