From fa6ed0d1f44420f813b1edbd77dd8cd0c7baed15 Mon Sep 17 00:00:00 2001 From: Tom Ross Date: Thu, 18 Jan 2007 23:37:51 +0000 Subject: 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 --- apps/plugins/disktidy.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'apps/plugins') diff --git a/apps/plugins/disktidy.c b/apps/plugins/disktidy.c index 53e322f2b1..bbd573c9d3 100644 --- a/apps/plugins/disktidy.c +++ b/apps/plugins/disktidy.c @@ -340,12 +340,13 @@ enum plugin_status tidy_do(enum tidy_system system) int tidy_lcd_menu(void) { - int loc, ret; + int loc, ret = 2; + bool menu_quit = false; static const struct menu_item items[] = { { "Start Cleaning", NULL }, - { "Files to Clean", NULL}, + { "Files to Clean", NULL }, { "Quit", NULL } }; @@ -353,33 +354,38 @@ int tidy_lcd_menu(void) { { "Mac", -1 }, { "Windows", -1 }, - { "Both", -1} + { "Both", -1 } }; loc = rb->menu_init(items, sizeof(items) / sizeof(*items), NULL, NULL, NULL, NULL); - while (true) + while (!menu_quit) { switch(rb->menu_show(loc)) { case 0: - return ret; + menu_quit = true; /* start cleaning */ + break; case 1: rb->set_option("Files to Clean", &ret, INT, system_option, 3, NULL); - break; + break; case 2: - return 99; + ret = 99; + menu_quit = true; + break; default: - return 99; + ret = 99; /* exit plugin */ + menu_quit = true; + break; } } - rb->menu_exit(loc); + return ret; } /* this is the plugin entry point */ -- cgit v1.2.3