--- pangoxft-fontmap.c.orig	2012-11-02 17:13:16.076307489 +0100
+++ pangoxft-fontmap.c	2012-11-02 17:19:59.561622896 +0100
@@ -150,8 +150,11 @@ close_display_cb (Display   *display,
       PangoXftFontMap *xftfontmap = tmp_list->data;
       tmp_list = tmp_list->next;
 
-      if (xftfontmap->display == display)
+      if (xftfontmap->display == display) {
+        G_UNLOCK (fontmaps);
 	pango_xft_shutdown_display (display, xftfontmap->screen);
+        G_LOCK (fontmaps);
+      }
     }
 
   registered_displays = g_slist_remove (registered_displays, display);
