aboutsummaryrefslogtreecommitdiffstats
path: root/src/custom.c
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2018-03-08 20:10:41 +0100
committerLukas Fleischer <lfleischer@calcurse.org>2018-07-28 14:21:38 +0200
commit3788df6d78a42ff1c8b8bfac02dd67345d01a23b (patch)
tree51122e1228ce8196c8d2dcd18c3a8d7697992391 /src/custom.c
parent5e5370864886c2e813b5335f6ef5cf5648f2ec02 (diff)
downloadcalcurse-3788df6d78a42ff1c8b8bfac02dd67345d01a23b.tar.gz
calcurse-3788df6d78a42ff1c8b8bfac02dd67345d01a23b.zip
Fix multiple, simultaneous periodic saves
A new save thread was started every time a positive periodic save value was input in the general options configuration menu. And only one thread can be stopped by entering 0, also when done repeatedly. Always stop the old thread before (possibly) starting a new. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/custom.c')
-rw-r--r--src/custom.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/custom.c b/src/custom.c
index 9443365..fff83d7 100644
--- a/src/custom.c
+++ b/src/custom.c
@@ -744,12 +744,12 @@ static void general_option_edit(int i)
status_mesg(periodic_save_str, "");
if (updatestring(win[STA].p, &buf, 0, 1) == 0) {
val = atoi(buf);
- if (val >= 0)
+ if (val >= 0) {
conf.periodic_save = val;
- if (conf.periodic_save > 0)
- io_start_psave_thread();
- else if (conf.periodic_save == 0)
io_stop_psave_thread();
+ if (conf.periodic_save > 0)
+ io_start_psave_thread();
+ }
}
break;
case CONFIRM_QUIT: