Esempio n. 1
0
void MenuSystemTerminate(MenuSystem *ms)
{
	MenuDestroySubmenus(ms->root);
	CFREE(ms->root);
	CArrayTerminate(&ms->exitTypes);
	CArrayTerminate(&ms->customDisplayFuncs);
	memset(ms, 0, sizeof *ms);
}
Esempio n. 2
0
void MenuSystemTerminate(MenuSystem *ms)
{
	MenuDestroySubmenus(ms->root);
	CFREE(ms->root);
	CFREE(ms->customDisplayFuncs);
	CFREE(ms->customDisplayDatas);
	memset(ms, 0, sizeof *ms);
}
Esempio n. 3
0
void MenuDestroy(MenuSystem *menu)
{
	if (menu == NULL || menu->root == NULL)
	{
		return;
	}
	MenuDestroySubmenus(menu->root);
	CFREE(menu->root);
	CFREE(menu);
}
Esempio n. 4
0
void MenuDestroySubmenus(menu_t *menu)
{
	if (menu == NULL)
	{
		return;
	}
	CFREE(menu->name);
	if (MenuTypeHasSubMenus(menu->type))
	{
		for (int i = 0; i < (int)menu->u.normal.subMenus.size; i++)
		{
			menu_t *subMenu = CArrayGet(&menu->u.normal.subMenus, i);
			MenuDestroySubmenus(subMenu);
		}
		CArrayTerminate(&menu->u.normal.subMenus);
	}
}
Esempio n. 5
0
void MenuDestroySubmenus(menu_t *menu)
{
	if (menu == NULL)
	{
		return;
	}
	if (MenuTypeHasSubMenus(menu->type) && menu->u.normal.subMenus != NULL)
	{
		int i;
		for (i = 0; i < menu->u.normal.numSubMenus; i++)
		{
			menu_t *subMenu = &menu->u.normal.subMenus[i];
			MenuDestroySubmenus(subMenu);
		}
		CFREE(menu->u.normal.subMenus);
	}
}