#ifdef HAVE_XIM
if (use_xim)
{
+ if (dpyinfo->xim)
+ XCloseIM (dpyinfo->xim);
xim = XOpenIM (dpyinfo->display, dpyinfo->xrdb, resource_name,
EMACS_CLASS);
dpyinfo->xim = xim;
#ifdef HAVE_X11R6_XIM
-struct xim_inst_t
-{
- struct x_display_info *dpyinfo;
- char *resource_name;
-};
-
/* XIM instantiate callback function, which is called whenever an XIM
server is available. DISPLAY is the display of the XIM.
CLIENT_DATA contains a pointer to an xim_inst_t structure created
struct x_display_info *dpyinfo;
char *resource_name;
{
+ dpyinfo->xim = NULL;
#ifdef HAVE_XIM
if (use_xim)
{
struct xim_inst_t *xim_inst;
int len;
- dpyinfo->xim = NULL;
xim_inst = (struct xim_inst_t *) xmalloc (sizeof (struct xim_inst_t));
+ dpyinfo->xim_callback_data = xim_inst;
xim_inst->dpyinfo = dpyinfo;
len = strlen (resource_name);
xim_inst->resource_name = (char *) xmalloc (len + 1);
least, hence the configure test. */
(XRegisterIMInstantiateCallback_arg6) xim_inst);
#else /* not HAVE_X11R6_XIM */
- dpyinfo->xim = NULL;
xim_open_dpy (dpyinfo, resource_name);
#endif /* not HAVE_X11R6_XIM */
-
}
- else
#endif /* HAVE_XIM */
- dpyinfo->xim = NULL;
}
XUnregisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb,
NULL, EMACS_CLASS,
xim_instantiate_callback, NULL);
-#else /* not HAVE_X11R6_XIM */
- /* If we have X11R6 xim, this causes a double-free. */
+ xfree (dpyinfo->xim_callback_data->resource_name);
+ xfree (dpyinfo->xim_callback_data);
+#endif /* HAVE_X11R6_XIM */
if (dpyinfo->display)
XCloseIM (dpyinfo->xim);
-#endif /* HAVE_X11R6_XIM */
dpyinfo->xim = NULL;
XFree (dpyinfo->xim_styles);
}
dpyinfo->x_focus_frame = 0;
dpyinfo->x_focus_event_frame = 0;
dpyinfo->x_highlight_frame = 0;
- dpyinfo->terminal->image_cache = make_image_cache ();
dpyinfo->wm_type = X_WMTYPE_UNKNOWN;
/* See if we can construct pixel values from RGB values. */
connection = ConnectionNumber (dpyinfo->display);
dpyinfo->connection = connection;
- {
- char null_bits[1];
-
- null_bits[0] = 0x00;
-
- dpyinfo->null_pixel
- = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window,
- null_bits, 1, 1, (long) 0, (long) 0,
- 1);
- }
-
{
extern int gray_bitmap_width, gray_bitmap_height;
extern char *gray_bitmap_bits;
#endif
xfree (dpyinfo->x_id_name);
+ xfree (dpyinfo->x_dnd_atoms);
xfree (dpyinfo->color_cells);
xfree (dpyinfo);
}