+GHashTable *menu_hash = NULL;
+
+void menu_destroy_hash_key(const gpointer data)
+{
+ g_free(data);
+}
+
+void menu_free_entries(const Menu *menu)
+{
+ GList *it;
+
+ for (it = menu->entries; it; it = it->next)
+ menu_entry_free((MenuEntry *)it->data);
+
+ g_list_free(menu->entries);
+}
+
+void menu_destroy_hash_value(const gpointer data)
+{
+ const Menu *del_menu = (Menu *)data;
+
+ g_free(del_menu->label);
+ g_free(del_menu->name);
+
+ menu_free_entries(del_menu);
+}
+
+void menu_entry_free(const MenuEntry *entry)
+{
+ g_free(entry->label);
+ g_free(entry->render_data);
+}
+
+void menu_startup()
+{
+ menu_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
+ menu_destroy_hash_key,
+ menu_destroy_hash_value);
+}
+
+void menu_shutdown()