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



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

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  <simon zheng sun com>
+
+	* 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  <srohini novell com>
 
 	* 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);
+		}
 	}
 }
 


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