Fix GUI not updating after deleting a tag.
authorAndrej Kacian <ticho@claws-mail.org>
Sun, 9 Apr 2017 16:31:52 +0000 (18:31 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Sun, 9 Apr 2017 16:31:52 +0000 (18:31 +0200)
Fixes bug #3744 - Crash upon deleting tags.

src/edittags.c

index a107c15..bd2cb91 100644 (file)
@@ -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;