diff options
author | Tom Ross <midgey@rockbox.org> | 2007-01-18 23:37:51 +0000 |
---|---|---|
committer | Tom Ross <midgey@rockbox.org> | 2007-01-18 23:37:51 +0000 |
commit | fa6ed0d1f44420f813b1edbd77dd8cd0c7baed15 (patch) | |
tree | e97b908887e28477ff55aea838a72b3c4bc0303d | |
parent | 11b06f042364e810f4ee5226dde2690682c66c4c (diff) | |
download | rockbox-fa6ed0d1f44420f813b1edbd77dd8cd0c7baed15.tar.gz rockbox-fa6ed0d1f44420f813b1edbd77dd8cd0c7baed15.zip |
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
-rw-r--r-- | apps/plugins/disktidy.c | 24 |
1 files changed, 15 insertions, 9 deletions
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) | |||
340 | 340 | ||
341 | int tidy_lcd_menu(void) | 341 | int tidy_lcd_menu(void) |
342 | { | 342 | { |
343 | int loc, ret; | 343 | int loc, ret = 2; |
344 | bool menu_quit = false; | ||
344 | 345 | ||
345 | static const struct menu_item items[] = | 346 | static const struct menu_item items[] = |
346 | { | 347 | { |
347 | { "Start Cleaning", NULL }, | 348 | { "Start Cleaning", NULL }, |
348 | { "Files to Clean", NULL}, | 349 | { "Files to Clean", NULL }, |
349 | { "Quit", NULL } | 350 | { "Quit", NULL } |
350 | }; | 351 | }; |
351 | 352 | ||
@@ -353,33 +354,38 @@ int tidy_lcd_menu(void) | |||
353 | { | 354 | { |
354 | { "Mac", -1 }, | 355 | { "Mac", -1 }, |
355 | { "Windows", -1 }, | 356 | { "Windows", -1 }, |
356 | { "Both", -1} | 357 | { "Both", -1 } |
357 | }; | 358 | }; |
358 | 359 | ||
359 | loc = rb->menu_init(items, sizeof(items) / sizeof(*items), | 360 | loc = rb->menu_init(items, sizeof(items) / sizeof(*items), |
360 | NULL, NULL, NULL, NULL); | 361 | NULL, NULL, NULL, NULL); |
361 | 362 | ||
362 | while (true) | 363 | while (!menu_quit) |
363 | { | 364 | { |
364 | switch(rb->menu_show(loc)) | 365 | switch(rb->menu_show(loc)) |
365 | { | 366 | { |
366 | 367 | ||
367 | case 0: | 368 | case 0: |
368 | return ret; | 369 | menu_quit = true; /* start cleaning */ |
370 | break; | ||
369 | 371 | ||
370 | case 1: | 372 | case 1: |
371 | rb->set_option("Files to Clean", &ret, INT, system_option, 3, NULL); | 373 | rb->set_option("Files to Clean", &ret, INT, system_option, 3, NULL); |
372 | break; | 374 | break; |
373 | 375 | ||
374 | case 2: | 376 | case 2: |
375 | return 99; | 377 | ret = 99; |
378 | menu_quit = true; | ||
379 | break; | ||
376 | 380 | ||
377 | default: | 381 | default: |
378 | return 99; | 382 | ret = 99; /* exit plugin */ |
383 | menu_quit = true; | ||
384 | break; | ||
379 | } | 385 | } |
380 | } | 386 | } |
381 | |||
382 | rb->menu_exit(loc); | 387 | rb->menu_exit(loc); |
388 | return ret; | ||
383 | } | 389 | } |
384 | 390 | ||
385 | /* this is the plugin entry point */ | 391 | /* this is the plugin entry point */ |