]> git.eshelyaron.com Git - emacs.git/commit
Plug various leaks and fix input method initialization
authorPo Lu <luangruo@yahoo.com>
Mon, 22 May 2023 03:52:33 +0000 (11:52 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 22 May 2023 03:54:00 +0000 (11:54 +0800)
commit6f940c6a1183dd1660f35e6c82d33183a6892cb4
tree5cbe8c7ca8e94f06b4f92267cf0bef3d8bb16fc6
parentc297b828bb716885f92d3117c2abbb1ff21dbb08
Plug various leaks and fix input method initialization

* src/image.c (free_bitmap_record): Free bm->name correctly even
if the display connection has been closed.
* src/xfns.c (x_window): Use dpyinfo-specific `use_xim' flag.
* src/xterm.c (use_xim): Remove global variable.
(xim_destroy_callback): Free `xim_styles' if present, and set it
to NULL to be on the safe side.
(xim_open_dpy): Consult dpyinfo->use_xim instead.  Don't leak
`xim_styles' if an IM was previously opened.
(xim_initialize): Use dpyinfo-specific `use_xim' flag.
(xim_close_dpy): Check if `dpyinfo->xim_callback_data' is set
before unregistering the instantiation callback.
(x_term_init): Determine whether or not to use XIM for each
display opened, instead of using the resources of the last
display opened to toggle a global flag.
(x_delete_terminal): Always call `image_destroy_all_bitmaps' and
`xim_close_dpy'.  Free storage used to hold bitmap records.
* src/xterm.h (struct x_display_info): New field `use_xim'.
src/image.c
src/xfns.c
src/xterm.c
src/xterm.h