Previous code where accumulating events from each iteration of the
planning. This code clears the old ones before adding new ones.

Signed-off-by: Anton Lundin <[email protected]>
---
 planner.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/planner.c b/planner.c
index 9196e3f..711dfa1 100644
--- a/planner.c
+++ b/planner.c
@@ -263,6 +263,10 @@ static void create_dive_from_plan(struct diveplan 
*diveplan)
        reset_cylinders(&displayed_dive);
        dc = &displayed_dive.dc;
        free(dc->sample);
+       while (ev = dc->events) {
+               dc->events = dc->events->next;
+               free(ev);
+       }
        dc->sample = NULL;
        dc->samples = 0;
        dc->alloc_samples = 0;
-- 
1.9.1

_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to