From cb5ca9c5436fe6d5f121da9314e9dbff58c59874 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Mon, 15 Jun 2009 10:50:09 +0000 Subject: [PATCH] (x_delete_terminal): Put previous change in #if 0 and add comment explaining why. --- src/ChangeLog | 5 +++++ src/xterm.c | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index cc5d3d630b0..87784746b9c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-06-15 YAMAMOTO Mitsuharu + + * xterm.c (x_delete_terminal): Put previous change in #if 0 and + add comment explaining why. + 2009-06-14 Sidney Markowitz * nsmenu.m (EmacsTooltip: setText): set height of tooltip. diff --git a/src/xterm.c b/src/xterm.c index 4c516264902..e3d4611523e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10747,7 +10747,18 @@ x_delete_terminal (struct terminal *terminal) /* Whether or not XCloseDisplay destroys the associated resource database depends on the version of libX11. To avoid both crash and memory leak, we dissociate the database from the - display and then destroy dpyinfo->xrdb ourselves. */ + display and then destroy dpyinfo->xrdb ourselves. + + Unfortunately, the above strategy does not work in some + situations due to a bug in newer versions of libX11: because + XrmSetDatabase doesn't clear the flag XlibDisplayDfltRMDB if + dpy->db is NULL, XCloseDisplay destroys the associated + database whereas it has not been created by XGetDefault + (Bug#21974 in freedesktop.org Bugzilla). As a workaround, we + don't destroy the database here in order to avoid the crash + in the above situations for now, though that may cause memory + leaks in other situations. */ +#if 0 #ifdef HAVE_XRMSETDATABASE XrmSetDatabase (dpyinfo->display, NULL); #else @@ -10757,6 +10768,7 @@ x_delete_terminal (struct terminal *terminal) some older versions of libX11 crash if we call it after closing all the displays. */ XrmDestroyDatabase (dpyinfo->xrdb); +#endif #ifdef USE_GTK xg_display_close (dpyinfo->display); -- 2.11.4.GIT