We have a hook into XCloseDisplay now, (cairo-xlib-screen.c:_cairo_xlib_close_display) In addition to cleaning up the _cairo_xlib_screen_list this function also needs to cleanup anything else that still refers to the same Display*. Specifically, any Xlib-specific glyph caches will need to be cleaned up. (I'm being intentionally vague about what/where those caches are as they are undergoing a big rewrite at the moment.)
Fixed in 96d8f58daf279238d3a1dfcd4ed3710014e2aeea
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.