diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-23 16:05:38 -1000 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-11-23 19:33:39 -0800 |
commit | a9786564c23fbf032f47096f543699c8c402785b (patch) | |
tree | 551231e54e017c9e83fd44da59edbe4c94dfa716 /divelist.c | |
parent | 10ce60e2120419282ff7694e8deda60e94832aa1 (diff) | |
download | subsurface-a9786564c23fbf032f47096f543699c8c402785b.tar.gz |
Allocate dive samples separately from 'struct dive'
We used to avoid some extra allocations by just allocating the dive
samples as part of the 'struct dive' allocation itself, but that ends up
complicating things, and will make it impossible to have multiple
different sets of samples (for multiple dive computers).
So stop doing it. Just allocate the dive samples array separately.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divelist.c')
-rw-r--r-- | divelist.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/divelist.c b/divelist.c index 37efed67a..13eda68b5 100644 --- a/divelist.c +++ b/divelist.c @@ -1931,6 +1931,7 @@ void delete_single_dive(int idx) dive_table.nr--; if (dive->selected) amount_selected--; + free(dive->sample); free(dive); } |