From 33250318b54bd6552d8e8dd1f26aad073d94e34c Mon Sep 17 00:00:00 2001 From: jstebbins Date: Tue, 19 Apr 2011 17:27:58 +0000 Subject: LinGui: fix a potential crash when hud is destroyed link list could be modified while being traversed in the "forall" method. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3940 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- gtk/src/ghbcompositor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gtk') diff --git a/gtk/src/ghbcompositor.c b/gtk/src/ghbcompositor.c index e65cfc657..7a05e58cd 100644 --- a/gtk/src/ghbcompositor.c +++ b/gtk/src/ghbcompositor.c @@ -439,12 +439,16 @@ ghb_compositor_forall( { GhbCompositor *compositor = GHB_COMPOSITOR (container); GhbCompositorChild *cc; - GList *link; + GList *link, *next; for (link = compositor->children; link != NULL; link = link->next) { + // The callback may cause the link to be removed from the list. + // So find next before calling callback + next = link->next; cc = (GhbCompositorChild*)link->data; (*callback)(cc->widget, data); + link = next; } } @@ -643,7 +647,7 @@ ghb_compositor_blend (GtkWidget *widget, GdkEventExpose *event) /* composite, with an opacity */ cairo_set_operator (cr, CAIRO_OPERATOR_OVER); cairo_paint_with_alpha (cr, cc->opacity); - cairo_reset_clip(cr); + gdk_cairo_reset_clip(cr, gtk_widget_get_window(widget)); } } /* we're done */ -- cgit v1.2.3