diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-09-27 21:55:03 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-09-29 15:24:08 -0700 |
commit | d3d06bc580b2a344806396622edd6b7adbdd08cc (patch) | |
tree | a01e60a760532364e017b9a97e3e3d62c874e285 /core/dive.h | |
parent | 574065b31430245a66808561b1b95139c4cd19f2 (diff) | |
download | subsurface-d3d06bc580b2a344806396622edd6b7adbdd08cc.tar.gz |
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>
Diffstat (limited to 'core/dive.h')
-rw-r--r-- | core/dive.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/dive.h b/core/dive.h index f8ccbf824..ccc15c782 100644 --- a/core/dive.h +++ b/core/dive.h @@ -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); |