mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
When a dive computer is deleted also clear its model
dive.c: A dive computer may have its model allocated in memory. Let's clear that as well when calling free_dc(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
906fd400e7
commit
310b05ac84
1 changed files with 2 additions and 0 deletions
2
dive.c
2
dive.c
|
@ -1251,6 +1251,8 @@ static void free_events(struct event *ev)
|
|||
static void free_dc(struct divecomputer *dc)
|
||||
{
|
||||
free(dc->sample);
|
||||
if (dc->model)
|
||||
free((void *)dc->model);
|
||||
free_events(dc->events);
|
||||
free(dc);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue