mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: add free_samples helper
And use it in the UI and planner code. See #1411 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
49f3da3bfd
commit
a5380bb741
4 changed files with 16 additions and 15 deletions
10
core/dive.c
10
core/dive.c
|
@ -754,6 +754,16 @@ void alloc_samples(struct divecomputer *dc, int num)
|
|||
}
|
||||
}
|
||||
|
||||
void free_samples(struct divecomputer *dc)
|
||||
{
|
||||
if (dc) {
|
||||
free(dc->sample);
|
||||
dc->sample = 0;
|
||||
dc->samples = 0;
|
||||
dc->alloc_samples = 0;
|
||||
}
|
||||
}
|
||||
|
||||
struct sample *prepare_sample(struct divecomputer *dc)
|
||||
{
|
||||
if (dc) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue