summaryrefslogtreecommitdiff
path: root/pango/pangoxft-fontmap.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-11-13 15:12:01 -0500
committerMatthias Clasen <mclasen@redhat.com>2012-11-13 15:12:01 -0500
commitb520a7a6346492b9ad950981ba9d3d516302173b (patch)
tree8f2af57f289d8115a520d5d805ad219af338a67b /pango/pangoxft-fontmap.c
parentfc31c06d5623653defdfde33ebbab44f9e5e89d0 (diff)
downloadpango-b520a7a6346492b9ad950981ba9d3d516302173b.tar.gz
Xft: Fix a deadlock on display close
We can't call pango_xft_shutdown display while holding the same lock it is taking. https://bugzilla.gnome.org/show_bug.cgi?id=687470
Diffstat (limited to 'pango/pangoxft-fontmap.c')
-rw-r--r--pango/pangoxft-fontmap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pango/pangoxft-fontmap.c b/pango/pangoxft-fontmap.c
index b8cdf304..9d210b50 100644
--- a/pango/pangoxft-fontmap.c
+++ b/pango/pangoxft-fontmap.c
@@ -143,8 +143,9 @@ close_display_cb (Display *display,
GSList *tmp_list;
G_LOCK (fontmaps);
+ tmp_list = g_slist_copy (fontmaps);
+ G_UNLOCK (fontmaps);
- tmp_list = fontmaps;
while (tmp_list)
{
PangoXftFontMap *xftfontmap = tmp_list->data;
@@ -154,9 +155,9 @@ close_display_cb (Display *display,
pango_xft_shutdown_display (display, xftfontmap->screen);
}
- registered_displays = g_slist_remove (registered_displays, display);
+ g_slist_free (tmp_list);
- G_UNLOCK (fontmaps);
+ registered_displays = g_slist_remove (registered_displays, display);
return 0;
}