mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
10ce60e212
commit
a9786564c2
7 changed files with 45 additions and 66 deletions
|
@ -1931,6 +1931,7 @@ void delete_single_dive(int idx)
|
|||
dive_table.nr--;
|
||||
if (dive->selected)
|
||||
amount_selected--;
|
||||
free(dive->sample);
|
||||
free(dive);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue