]> git.eshelyaron.com Git - emacs.git/commit
Prevent crashes in xwidgets whose buffers have been killed
authorPo Lu <luangruo@yahoo.com>
Fri, 12 Nov 2021 00:17:41 +0000 (08:17 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 12 Nov 2021 00:17:41 +0000 (08:17 +0800)
commit554a875493680f8b52821267ee88e191d462ea36
tree22bd120a4d1cfc3c8cc99bf17a6361437e140399
parenta8fc08085110de00ebcbd67b5273a755a5cb8ea1
Prevent crashes in xwidgets whose buffers have been killed

* doc/lispref/display.texi (Xwidgets): Explain meaning of killed
xwidgets.
* src/xwidget.c (Fxwidget_live_p): New function.
(Fxwidget_perform_lispy_event, WEBKIT_FN_INIT)
(Fxwidget_resize, Fxwidget_size_request)
(Fxwidget_info, Fxwidget_plist)
(Fset_xwidget_buffer, Fset_xwidget_plist)
(Fset_xwidget_query_on_exit_flag)
(Fxwidget_query_on_exit_flag)
(Fxwidget_webkit_search)
(Fxwidget_webkit_next_result)
(Fxwidget_webkit_previous_result)
(Fxwidget_webkit_finish_search)
(Fxwidget_webkit_load_html): Check for live xwidgets instead of
just xwidgets.

(xwidget_button, xwidget_motion_or_crossing)
(xv_do_draw, x_draw_xwidget_glyph_string)
(Fdelete_xwidget_view): Ignore killed xwidgets.

(syms_of_xwidget): Define new symbols and subrs and define
appropriate weakness of id_to_xwidget map.
(kill_buffer_xwidgets): Check live xwidgets instead of
killed xwidgets, set xwidget buffer to nil, and rely on GC to
free the hash table for us instead.

* src/xwidget.h (XWIDGET_LIVE_P, CHECK_LIVE_XWIDGET): New
macros.
doc/lispref/display.texi
src/xwidget.c
src/xwidget.h