1
0
Fork 0
forked from len0rd/rockbox

Hopefully fix the menu leak I introduced in my last version. Also some whitespace changes.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12069 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Tom Ross 2007-01-18 23:37:51 +00:00
parent 11b06f0423
commit fa6ed0d1f4

View file

@ -340,7 +340,8 @@ enum plugin_status tidy_do(enum tidy_system system)
int tidy_lcd_menu(void) int tidy_lcd_menu(void)
{ {
int loc, ret; int loc, ret = 2;
bool menu_quit = false;
static const struct menu_item items[] = static const struct menu_item items[] =
{ {
@ -359,27 +360,32 @@ int tidy_lcd_menu(void)
loc = rb->menu_init(items, sizeof(items) / sizeof(*items), loc = rb->menu_init(items, sizeof(items) / sizeof(*items),
NULL, NULL, NULL, NULL); NULL, NULL, NULL, NULL);
while (true) while (!menu_quit)
{ {
switch(rb->menu_show(loc)) switch(rb->menu_show(loc))
{ {
case 0: case 0:
return ret; menu_quit = true; /* start cleaning */
break;
case 1: case 1:
rb->set_option("Files to Clean", &ret, INT, system_option, 3, NULL); rb->set_option("Files to Clean", &ret, INT, system_option, 3, NULL);
break; break;
case 2: case 2:
return 99; ret = 99;
menu_quit = true;
break;
default: default:
return 99; ret = 99; /* exit plugin */
menu_quit = true;
break;
} }
} }
rb->menu_exit(loc); rb->menu_exit(loc);
return ret;
} }
/* this is the plugin entry point */ /* this is the plugin entry point */