repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: ec734583a77618567e5369cf1cb0d5e4b13b0326: path_to: revision_to:
commit ec734583a77618567e5369cf1cb0d5e4b13b0326 Author: Emanuele GiaquintaDate: Mon Aug 23 16:06:44 2010 +0000 Revert last change. diff --git a/src/keyboard.C b/src/keyboard.C
--- a/src/keyboard.C
+++ b/src/keyboard.C
@@ -173,6 +173,21 @@ keyboard_manager::clear ()
{
keymap.clear ();
hash [0] = 2;
+
+ for (unsigned int i = 0; i < user_translations.size (); ++i)
+ {
+ free ((void *)user_translations [i]);
+ user_translations [i] = 0;
+ }
+
+ for (unsigned int i = 0; i < user_keymap.size (); ++i)
+ {
+ delete user_keymap [i];
+ user_keymap [i] = 0;
+ }
+
+ user_keymap.clear ();
+ user_translations.clear ();
}
// a wrapper for register_keymap,
@@ -214,6 +229,8 @@ keyboard_manager::register_user_translation (KeySym keysym, unsigned int state,
else if (strncmp (translation, "builtin:", 8) == 0)
key->type = keysym_t::BUILTIN;
+ user_keymap.push_back (key);
+ user_translations.push_back (translation);
register_keymap (key);
}
else
diff --git a/src/keyboard.h b/src/keyboard.h
--- a/src/keyboard.h +++ b/src/keyboard.h @@ -95,6 +95,9 @@ private: // stock keymaps are all static data static keysym_t stock_keymap[]; #endif + // user keymaps and their .string are dynamically allocated and freed + vectoruser_keymap; + vector user_translations; }; #endif /* KEYSYM_RESOURCE */
-----END OF PAGE-----