From 2775e7e9910ec76f47f7568f02a06c84c01265fa Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 15 Oct 2018 15:16:39 +0200 Subject: Dive import: remove dive-to-be added from trip before deletion On dive import, dives to be added may be merged into already existing dives. In such a case, the dive to be added is deleted. Before doing so, it must be removed from the trip is belongs to to avoid corruption of the trip-list. Signed-off-by: Berthold Stoeger --- core/divelist.c | 1 + 1 file changed, 1 insertion(+) (limited to 'core/divelist.c') diff --git a/core/divelist.c b/core/divelist.c index 65c3298c8..922c04e43 100644 --- a/core/divelist.c +++ b/core/divelist.c @@ -1507,6 +1507,7 @@ static bool try_to_merge_into(struct dive *dive_to_add, int idx, bool prefer_imp add_dive_to_trip(merged, trip); } free_dive(old_dive); + remove_dive_from_trip(dive_to_add, false); free_dive(dive_to_add); return true; -- cgit v1.2.3-70-g09d2