From 63286bb2ec6f95a7baddb1e3b336de4c473ba24f Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 13 Jan 2010 13:35:36 -0500 Subject: [PATCH] Fix gc bug in terminal allocation. * xterm.c (x_term_init): Avoid garbage-collecting the new terminal during call to vendor-specific-keysyms (Bug#5365). --- src/ChangeLog | 5 +++++ src/xterm.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 8389fdcd83f..0930d06db91 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-01-13 Chong Yidong + + * xterm.c (x_term_init): Avoid garbage-collecting the new terminal + during call to vendor-specific-keysyms (Bug#5365). + 2010-01-13 YAMAMOTO Mitsuharu * keyboard.c (input_available_signal) [SYNC_INPUT]: diff --git a/src/xterm.c b/src/xterm.c index 22d9f67782d..72dff200d82 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10218,13 +10218,16 @@ x_term_init (display_name, xrm_option, resource_name) if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound)) { char *vendor = ServerVendor (dpy); - /* Temporarily hide the partially initialized terminal */ + /* Temporarily hide the partially initialized terminal, + but make sure it doesn't get garbage collected. */ + int count = inhibit_garbage_collection (); terminal_list = terminal->next_terminal; UNBLOCK_INPUT; terminal->kboard->Vsystem_key_alist = call1 (Qvendor_specific_keysyms, vendor ? build_string (vendor) : empty_unibyte_string); BLOCK_INPUT; + unbind_to (count, Qnil); terminal->next_terminal = terminal_list; terminal_list = terminal; } -- 2.39.2