[gtkhtml] Fix for Evolution crashes with Redo operation twice after paste quatations

"simon.zheng" <[email protected]>
Newsgroups gmane.comp.gnome.evolution.patches
Message-ID <1139219293.3763.6.camel@fulltime>
Hi Guys,

Here's bug info.
http://bugzilla.gnome.org/show_bug.cgi?id=327850

At this case, undo_used.stack is empty when the second redo operation is done.
Thus, we should check if this stack is empty at first.

Please review and comment.

Thanks,
-Simon

_______________________________________________
Evolution-patches mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/evolution-patches
gtkhtml-327850-redo-twice.diff (text/x-patch, 1.3 KB)
Index: src/ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2157
diff -u -p -r1.2157 ChangeLog
--- src/ChangeLog	27 Jan 2006 08:08:36 -0000	1.2157
+++ src/ChangeLog	6 Feb 2006 09:23:56 -0000
@@ -1,3 +1,10 @@
+2006-02-06  Simon Zheng  <[email protected]>
+
+	* htmlundo.c (action_do_and_destroy_redo): As undo_used stack is 
+	possibly empty, check validity at first.
+
+	Fixed bug #327850
+
 2006-01-20  Rohini S  <[email protected]>
 
 	* htmlengine.c (element_parse_tr): Function modified to set
Index: src/htmlundo.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlundo.c,v
retrieving revision 1.19
diff -u -p -r1.19 htmlundo.c
--- src/htmlundo.c	13 Apr 2005 15:35:32 -0000	1.19
+++ src/htmlundo.c	6 Feb 2006 09:23:56 -0000
@@ -140,8 +140,10 @@ action_do_and_destroy_redo (HTMLEngine *
 		html_undo_action_destroy (action);
 
 		first = undo->undo_used.stack;
-		html_undo_action_destroy (HTML_UNDO_ACTION (first->data));
-		undo->undo_used.stack = g_list_remove (first, first->data);
+		if (first) {
+			html_undo_action_destroy (HTML_UNDO_ACTION (first->data));
+			undo->undo_used.stack = g_list_remove (first, first->data);
+		}
 	}
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.