summaryrefslogtreecommitdiffstats
path: root/gtk/src/ghbcompositor.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-04-19 17:27:58 +0000
committerjstebbins <[email protected]>2011-04-19 17:27:58 +0000
commit33250318b54bd6552d8e8dd1f26aad073d94e34c (patch)
tree931270c730567c376be7be46ced126c790ec4db1 /gtk/src/ghbcompositor.c
parent9c94517108b677e2f1d71e1bd332ee70210720f6 (diff)
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
Diffstat (limited to 'gtk/src/ghbcompositor.c')
-rw-r--r--gtk/src/ghbcompositor.c8
1 files changed, 6 insertions, 2 deletions
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 */