From fbc4b2ac722820f41f25cd72eeda3ce54cc356d0 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 29 Sep 2018 14:58:04 +0200 Subject: [PATCH] Mobile: don't call clear_dive() on deleteDive clear_dive() will be called anyway in the subsequent call to copy_dive(). Signed-off-by: Berthold Stoeger --- mobile-widgets/qmlmanager.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 7df920478..67f99b8d5 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1294,11 +1294,9 @@ void QMLManager::deleteDive(int id) appendTextToLog("trying to delete non-existing dive"); return; } - // clean up (or create) the storage for the deleted dive and trip (if applicable) + // create the storage for the deleted dive and trip (if applicable) if (!deletedDive) deletedDive = alloc_dive(); - else - clear_dive(deletedDive); copy_dive(d, deletedDive); if (!deletedTrip) { deletedTrip = (struct dive_trip *)calloc(1, sizeof(struct dive_trip));