[gtksourceview] Fix infinite loop when painting marks background
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Fix infinite loop when painting marks background
- Date: Fri, 1 Mar 2013 21:51:49 +0000 (UTC)
commit 203150bf8752ee7841b1ef593312b0bfba590f68
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Mar 1 22:40:10 2013 +0100
Fix infinite loop when painting marks background
The loop was:
while (marks != NULL)
{
/* blabla */
marks = g_slist_delete_link (marks, marks);
}
So if the 'continue' was reached, 'marks' remained the same and
therefore there was an infinite loop.
gtksourceview/gtksourceview.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index fd698a9..3d99d10 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -1831,12 +1831,8 @@ gtk_source_view_paint_marks_background (GtkSourceView *view,
gtk_source_mark_get_category
(marks->data),
&prio);
- if (attrs == NULL)
- {
- continue;
- }
-
- if (prio > priority &&
+ if (attrs != NULL &&
+ prio > priority &&
gtk_source_mark_attributes_get_background (attrs, &bg))
{
priority = prio;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]