summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/main.c b/main.c
index ca3722383..88a28c8c2 100644
--- a/main.c
+++ b/main.c
@@ -138,14 +138,12 @@ void report_dives(gboolean is_imported)
/* careful - we might free the dive that last points to. Oops... */
if (last == prev || last == dive)
last = merged;
- free(prev);
- free(dive);
- *pp = merged;
- dive_table.nr--;
- memmove(pp+1, pp+2, sizeof(*pp)*(dive_table.nr - i));
/* Redo the new 'i'th dive */
i--;
+ add_single_dive(i, merged);
+ delete_single_dive(i+1);
+ delete_single_dive(i+1);
}
if (is_imported) {