Jakub Filak b69ae4
From 109702a42d08e52f54c5f740b370a3ec9a3a5d16 Mon Sep 17 00:00:00 2001
Jakub Filak b69ae4
From: Jakub Filak <jfilak@redhat.com>
Jakub Filak b69ae4
Date: Wed, 30 Jul 2014 13:44:02 +0200
Jakub Filak b69ae4
Subject: [PATCH 17/20] gui: clear the sensitive cache between two event runs
Jakub Filak b69ae4
Jakub Filak b69ae4
Was causing a SIGSEGV.
Jakub Filak b69ae4
Jakub Filak b69ae4
Related to rhbz#1069917
Jakub Filak b69ae4
Jakub Filak b69ae4
Signed-off-by: Jakub Filak <jfilak@redhat.com>
Jakub Filak b69ae4
---
Jakub Filak b69ae4
 src/gui-wizard-gtk/wizard.c | 25 +++++++++++++++++++++++++
Jakub Filak b69ae4
 1 file changed, 25 insertions(+)
Jakub Filak b69ae4
Jakub Filak b69ae4
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
Jakub Filak b69ae4
index 5c4bd6a..fc44547 100644
Jakub Filak b69ae4
--- a/src/gui-wizard-gtk/wizard.c
Jakub Filak b69ae4
+++ b/src/gui-wizard-gtk/wizard.c
Jakub Filak b69ae4
@@ -1123,6 +1123,31 @@ static void remove_tabs_from_notebook(GtkNotebook *notebook)
Jakub Filak b69ae4
         */
Jakub Filak b69ae4
         gtk_notebook_remove_page(notebook, 0); //we need to always the page 0
Jakub Filak b69ae4
     }
Jakub Filak b69ae4
+
Jakub Filak b69ae4
+    /* Turn off the changed callback during the update */
Jakub Filak b69ae4
+    g_signal_handler_block(g_tv_sensitive_sel, g_tv_sensitive_sel_hndlr);
Jakub Filak b69ae4
+
Jakub Filak b69ae4
+    g_current_highlighted_word = NULL;
Jakub Filak b69ae4
+
Jakub Filak b69ae4
+    GtkTreeIter iter;
Jakub Filak b69ae4
+    gboolean valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_ls_sensitive_list), &iter);
Jakub Filak b69ae4
+    while (valid)
Jakub Filak b69ae4
+    {
Jakub Filak b69ae4
+        char *text = NULL;
Jakub Filak b69ae4
+        search_item_t *word = NULL;
Jakub Filak b69ae4
+
Jakub Filak b69ae4
+        gtk_tree_model_get(GTK_TREE_MODEL(g_ls_sensitive_list), &iter,
Jakub Filak b69ae4
+                SEARCH_COLUMN_TEXT, &text,
Jakub Filak b69ae4
+                SEARCH_COLUMN_ITEM, &word,
Jakub Filak b69ae4
+                -1);
Jakub Filak b69ae4
+
Jakub Filak b69ae4
+        free(text);
Jakub Filak b69ae4
+        free(word);
Jakub Filak b69ae4
+
Jakub Filak b69ae4
+        valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(g_ls_sensitive_list), &iter);
Jakub Filak b69ae4
+    }
Jakub Filak b69ae4
+    gtk_list_store_clear(g_ls_sensitive_list);
Jakub Filak b69ae4
+    g_signal_handler_unblock(g_tv_sensitive_sel, g_tv_sensitive_sel_hndlr);
Jakub Filak b69ae4
 }
Jakub Filak b69ae4
 
Jakub Filak b69ae4
 static void append_item_to_ls_details(gpointer name, gpointer value, gpointer data)
Jakub Filak b69ae4
-- 
Jakub Filak b69ae4
2.0.4
Jakub Filak b69ae4