int do_rescan(struct params_t *params) { int i; /* Clean top menu level except system menu item */ /* FIXME should be done by some function from menu module */ kx_menu_item *mi; for (i = 1; i < params->menu->top->count; i++) { mi = params->menu->top->list[i]; if (mi) { dispose(mi->label); dispose(mi->description); free(mi); } params->menu->top->list[i] = NULL; } params->menu->top->count = 1; #ifdef USE_ICONS /* Destroy icons */ /* FIXME should be done by some function from devicescan module */ for (i = 0; i < params->bootcfg->fill; i++) { fb_destroy_picture(params->bootcfg->list[i]->icondata); } #endif free_bootcfg(params->bootcfg); params->bootcfg = NULL; scan_devices(params); return fill_menu(params); }
/* Destroy gui */ void gui_destroy(struct gui_t *gui) { if (NULL == gui) return; #ifdef USE_ICONS enum icon_id_t i; for (i=ICON_LOGO; i<ICON_ARRAY_SIZE; i++) { fb_destroy_picture(gui->icons[i]); } free(gui->icons); #endif fb_destroy(gui->fb); free(gui); }