[gedit] Avoid crash when removing the highlighted text.



commit 65f38face0b393c227b0077c03bd173dba4f4aed
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Apr 6 11:11:30 2011 +0200

    Avoid crash when removing the highlighted text.
    
    We must block the changed signal when setting "" in the entry
    to avoid an useless search and a crash as the text mark for the
    start of the text is deleted when the popup is hidden.

 gedit/gedit-view-frame.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gedit/gedit-view-frame.c b/gedit/gedit-view-frame.c
index f53cedd..840c66c 100644
--- a/gedit/gedit-view-frame.c
+++ b/gedit/gedit-view-frame.c
@@ -1272,8 +1272,6 @@ start_interactive_search_real (GeditViewFrame *frame)
 	GtkTextMark *mark;
 	GtkTextIter iter;
 
-	/* FIXME: it enters here twice, why? */
-
 	if (gtk_widget_get_visible (frame->priv->slider))
 	{
 		if (frame->priv->search_mode != frame->priv->request_search_mode)
@@ -1482,7 +1480,11 @@ gedit_view_frame_clear_search (GeditViewFrame *frame)
 	doc = gedit_view_frame_get_document (frame);
 
 	gedit_document_set_search_text (doc, "", GEDIT_SEARCH_DONT_SET_FLAGS);
+	g_signal_handler_block (frame->priv->search_entry,
+	                        frame->priv->search_entry_changed_id);
 	gtk_entry_set_text (GTK_ENTRY (frame->priv->search_entry), "");
+	g_signal_handler_unblock (frame->priv->search_entry,
+	                          frame->priv->search_entry_changed_id);
 
 	gtk_widget_grab_focus (frame->priv->view);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]