mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: split out free_dive() function from delete_single_dive()
Currently, we can only delete dives that are indexed in the main dive table. In the future, we will have to delete dives outside of this table (e.g. for undo). Therefore, split out the free_dive() function from delete_single_dive(), which takes an index into the main dive table. In the process, adopt the dive freeing-code from clear_dive(), which frees more data than the code in delete_single_dive(). This potentially fixes a memory-leak. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
574065b314
commit
d3d06bc580
3 changed files with 20 additions and 13 deletions
|
@ -544,6 +544,7 @@ extern timestamp_t utc_mktime(struct tm *tm);
|
|||
extern void utc_mkdate(timestamp_t, struct tm *tm);
|
||||
|
||||
extern struct dive *alloc_dive(void);
|
||||
extern void free_dive(struct dive *);
|
||||
extern void record_dive_to_table(struct dive *dive, struct dive_table *table);
|
||||
extern void record_dive(struct dive *dive);
|
||||
extern void clear_dive(struct dive *dive);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue