mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 21:33:24 +00:00
core: on import remove merged dives from trip/divesite
When dives were merged on import, they were not unregistered from their dive site and trip before being deleted. Thus, these tables had stale pointers, which would ultimate lead to crashes. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
43f15f1b48
commit
b2b3544f3f
1 changed files with 4 additions and 0 deletions
|
@ -857,6 +857,10 @@ static void merge_imported_dives(struct dive_table *table)
|
|||
merged->dive_site = NULL;
|
||||
add_dive_to_dive_site(merged, ds);
|
||||
}
|
||||
unregister_dive_from_dive_site(prev);
|
||||
unregister_dive_from_dive_site(dive);
|
||||
unregister_dive_from_trip(prev);
|
||||
unregister_dive_from_trip(dive);
|
||||
|
||||
/* Overwrite the first of the two dives and remove the second */
|
||||
free_dive(prev);
|
||||
|
|
Loading…
Add table
Reference in a new issue