changeset 99379:3f2f25d635e6

(xim_close_dpy): Avoid double-free on X11R6 XIM.
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 04 Nov 2008 16:47:34 +0000
parents e2dea54cb619
children 3106ccb4fc25
files src/xterm.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Tue Nov 04 16:46:54 2008 +0000
+++ b/src/xterm.c	Tue Nov 04 16:47:34 2008 +0000
@@ -8319,9 +8319,11 @@
 	XUnregisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb,
 					  NULL, EMACS_CLASS,
 					  xim_instantiate_callback, NULL);
-#endif /* not HAVE_X11R6_XIM */
+#else /* not HAVE_X11R6_XIM */
+      /* If we have X11R6 xim, this causes a double-free.  */
       if (dpyinfo->display)
 	XCloseIM (dpyinfo->xim);
+#endif /* HAVE_X11R6_XIM */
       dpyinfo->xim = NULL;
       XFree (dpyinfo->xim_styles);
     }