[PATCH] delete_dive_cb: obtain the dive before calling delete_single_dive()

Lubomir I. Ivanov neolit123 at gmail.com
Thu Sep 27 14:32:21 PDT 2012


From: "Lubomir I. Ivanov" <neolit123 at gmail.com>

delete_single_dive() should be called last in the said function,
since it modifies the tree for update_trip_timestamp() to work.

Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
---
 divelist.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/divelist.c b/divelist.c
index ce9796d..7fa6bac 100644
--- a/divelist.c
+++ b/divelist.c
@@ -1935,10 +1935,9 @@ static void delete_dive_cb(GtkWidget *menuitem, GtkTreePath *path)
 	GtkTreeSelection *selection = gtk_tree_view_get_selection(tree_view);

 	gtk_tree_model_get_iter(MODEL(dive_list), &iter, path);
-	delete_single_dive(&iter);
-
 	gtk_tree_model_get(MODEL(dive_list), &iter, DIVE_INDEX, &idx, -1);
 	dive = get_dive(idx);
+	delete_single_dive(&iter);

 	/* now make sure the correct dive list is displayed, the same
 	 * dives stay selected and if necessary their trips are
--
1.7.11.msysgit.0



More information about the subsurface mailing list