mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-03-22 06:41:04 -07:00
[MPS] Protect Lisp_Objects in per-terminal coding systems
* src/terminal.c (create_terminal): Create roots for the new 'safe_charsets_string' members, as well as 'src_object' and 'dst_object'. (delete_terminal_internal): Destroy them.
This commit is contained in:
parent
53c2aa5e3a
commit
0e36cf3161
1 changed files with 17 additions and 0 deletions
|
|
@ -309,7 +309,13 @@ create_terminal (enum output_method type, struct redisplay_interface *rif)
|
|||
|
||||
#ifdef HAVE_MPS
|
||||
terminal->keyboard_coding = xzalloc (sizeof (struct coding_system));
|
||||
igc_root_create_n (&terminal->keyboard_coding->src_object, 1);
|
||||
igc_root_create_n (&terminal->keyboard_coding->dst_object, 1);
|
||||
igc_root_create_n (&terminal->keyboard_coding->safe_charsets_string, 1);
|
||||
terminal->terminal_coding = xzalloc (sizeof (struct coding_system));
|
||||
igc_root_create_n (&terminal->terminal_coding->src_object, 1);
|
||||
igc_root_create_n (&terminal->terminal_coding->dst_object, 1);
|
||||
igc_root_create_n (&terminal->terminal_coding->safe_charsets_string, 1);
|
||||
#else
|
||||
terminal->keyboard_coding = xmalloc (sizeof (struct coding_system));
|
||||
terminal->terminal_coding = xmalloc (sizeof (struct coding_system));
|
||||
|
|
@ -378,8 +384,19 @@ delete_terminal_internal (struct terminal *terminal)
|
|||
emacs_abort ();
|
||||
*tp = terminal->next_terminal;
|
||||
|
||||
#ifdef HAVE_MPS
|
||||
igc_destroy_root_with_start (&terminal->keyboard_coding->src_object);
|
||||
igc_destroy_root_with_start (&terminal->keyboard_coding->dst_object);
|
||||
igc_destroy_root_with_start (&terminal->keyboard_coding->safe_charsets_string);
|
||||
#endif
|
||||
xfree (terminal->keyboard_coding);
|
||||
terminal->keyboard_coding = NULL;
|
||||
|
||||
#ifdef HAVE_MPS
|
||||
igc_destroy_root_with_start (&terminal->terminal_coding->src_object);
|
||||
igc_destroy_root_with_start (&terminal->terminal_coding->dst_object);
|
||||
igc_destroy_root_with_start (&terminal->terminal_coding->safe_charsets_string);
|
||||
#endif
|
||||
xfree (terminal->terminal_coding);
|
||||
terminal->terminal_coding = NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue