From 9eb1c969c85d38b31c12ec188eec8932e522a45d Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Sun, 9 Apr 2017 18:31:52 +0200 Subject: [PATCH] Fix GUI not updating after deleting a tag. Fixes bug #3744 - Crash upon deleting tags. --- src/edittags.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/edittags.c b/src/edittags.c index a107c158e..bd2cb914d 100644 --- a/src/edittags.c +++ b/src/edittags.c @@ -225,6 +225,13 @@ static void apply_popup_delete (GtkAction *action, gpointer data) gtk_tree_model_get(model, &sel, TAG_DATA, &id, -1); + + /* Even though this is not documented, gtk_tree_model_get() + * seems to invalidate the GtkTreeIter that is passed to it, + * so we need to reacquire it. */ + if (!gtk_tree_selection_get_selected(selection, NULL, &sel)) + return; + gtk_list_store_remove(GTK_LIST_STORE(model), &sel); if (mainwindow_get_mainwindow() != NULL) summaryview = mainwindow_get_mainwindow()->summaryview; -- 2.25.1