summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-07-09 13:36:22 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-07-09 13:36:22 +0000
commit402b8ebeae49b498d725f85262a02e718c8c2f11 (patch)
treefa16d22e577a65e106227b7c70ee1002c2419428
parent96f2a9dad198eee48a7bbb0614e1e668eb21a6d3 (diff)
fix FS#9383 (chessclock freezes on deleting a player), patch by Yoshihisa Uchida.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21733 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/chessclock.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c
index a69b3bb582..514cac174e 100644
--- a/apps/plugins/chessclock.c
+++ b/apps/plugins/chessclock.c
@@ -367,17 +367,22 @@ enum plugin_status plugin_start(const void* parameter)
do {
int ret=0;
done=true;
- for (i=0; done && i<settings.nr_timers; i++) {
+ i = nr;
+ do {
if (!timer_holder[i].hidden)
- done=false;
- }
+ {
+ nr = i;
+ done = false;
+ break;
+ }
+ if (++i == settings.nr_timers)
+ i = 0;
+ } while (i != nr);
+
if (done) {
return PLUGIN_OK;
}
- if (!timer_holder[nr].hidden) {
- done=false;
- ret=run_timer(nr);
- }
+ ret = run_timer(nr);
switch (ret) {
case -1: /* exit */
done=true;
@@ -390,9 +395,11 @@ enum plugin_status plugin_start(const void* parameter)
nr=0;
break;
case 2:
- nr--;
- if (nr<0)
- nr=settings.nr_timers-1;
+ do {
+ nr--;
+ if (nr<0)
+ nr=settings.nr_timers-1;
+ } while (timer_holder[nr].hidden);
break;
}
} while (!done);
@@ -521,7 +528,7 @@ static int run_timer(int nr)
switch(rb->do_menu(&menu, NULL, NULL, false))
{
case 0:
- /* delete timer */
+ /* delete player */
timer_holder[nr].hidden=true;
retval=1;
done=true;