]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix gc bug in terminal allocation.
authorChong Yidong <cyd@stupidchicken.com>
Wed, 13 Jan 2010 18:35:36 +0000 (13:35 -0500)
committerChong Yidong <cyd@stupidchicken.com>
Wed, 13 Jan 2010 18:35:36 +0000 (13:35 -0500)
* xterm.c (x_term_init): Avoid garbage-collecting the new terminal
during call to vendor-specific-keysyms (Bug#5365).

src/ChangeLog
src/xterm.c

index 8389fdcd83ff84d2f5bcb850ec4e882e023c48d4..0930d06db910a7181e6e58e7816ba1b0572f8208 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-13  Chong Yidong  <cyd@stupidchicken.com>
+
+       * xterm.c (x_term_init): Avoid garbage-collecting the new terminal
+       during call to vendor-specific-keysyms (Bug#5365).
+
 2010-01-13  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * keyboard.c (input_available_signal) [SYNC_INPUT]:
index 22d9f67782d5c3afa9d132cc552776f1bfa7e4d0..72dff200d829199980c640e72f6ecf71863267c2 100644 (file)
@@ -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;
          }