From f7f49da17ca1352bd86b903d7bac448c3c5174e3 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 16 Jul 2014 15:52:33 +0200 Subject: Initialize linked list for recurrent items When switching to the generic linked list implementation for recurring events in 9fab248 (Use generic lists for recurring apointments and events., 2011-04-16), no initialization routine for the list of recurring events was added. Fix this and properly initialize the list on startup. Signed-off-by: Lukas Fleischer --- src/calcurse.c | 1 + src/calcurse.h | 1 + src/dmon.c | 1 + src/recur.c | 5 +++++ 4 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/calcurse.c b/src/calcurse.c index b128dbd..389334d 100644 --- a/src/calcurse.c +++ b/src/calcurse.c @@ -518,6 +518,7 @@ int main(int argc, char **argv) /* Initialize non-thread-safe data structures. */ event_llist_init(); + recur_event_llist_init(); todo_init_list(); /* diff --git a/src/calcurse.h b/src/calcurse.h index 6112ede..16ca155 100644 --- a/src/calcurse.h +++ b/src/calcurse.h @@ -892,6 +892,7 @@ void recur_apoint_free_bkp(void); void recur_event_free(struct recur_event *); void recur_apoint_free(struct recur_apoint *); void recur_apoint_llist_init(void); +void recur_event_llist_init(void); void recur_apoint_llist_free(void); void recur_event_llist_free(void); struct recur_apoint *recur_apoint_new(char *, char *, long, long, char, diff --git a/src/dmon.c b/src/dmon.c index 5653073..c51ee70 100644 --- a/src/dmon.c +++ b/src/dmon.c @@ -163,6 +163,7 @@ void dmon_start(int parent_exit_status) apoint_llist_init(); recur_apoint_llist_init(); event_llist_init(); + recur_event_llist_init(); todo_init_list(); io_load_app(); data_loaded = 1; diff --git a/src/recur.c b/src/recur.c index 801346d..69706b0 100644 --- a/src/recur.c +++ b/src/recur.c @@ -140,6 +140,11 @@ void recur_apoint_llist_init(void) LLIST_TS_INIT(&recur_alist_p); } +void recur_event_llist_init(void) +{ + LLIST_INIT(&recur_elist); +} + void recur_apoint_free(struct recur_apoint *rapt) { mem_free(rapt->mesg); -- cgit v1.2.3-70-g09d2