1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-25 23:10:47 -08:00

(delete_kboard): Prevent a dangling reference

from current_kboard to KB, which is freed.
This commit is contained in:
Gerd Moellmann 2001-04-19 13:00:29 +00:00
parent a2fab450ed
commit a122a38eee
2 changed files with 19 additions and 2 deletions

View file

@ -1,5 +1,8 @@
2001-04-19 Gerd Moellmann <gerd@gnu.org>
* keyboard.c (delete_kboard): Prevent a dangling reference
from current_kboard to KB, which is freed.
* process.c (wait_reading_process_input): Call
record_asynch_buffer_change after running timers, to make
read_key_sequence aware of buffer changes from under it.

View file

@ -10013,19 +10013,33 @@ wipe_kboard (kb)
}
#ifdef MULTI_KBOARD
/* Free KB and memory referenced from it. */
void
delete_kboard (kb)
KBOARD *kb;
KBOARD *kb;
{
KBOARD **kbp;
for (kbp = &all_kboards; *kbp != kb; kbp = &(*kbp)->next_kboard)
if (*kbp == NULL)
abort ();
*kbp = kb->next_kboard;
/* Prevent a dangling reference to KB. */
if (kb == current_kboard)
{
current_kboard = SELECTED_FRAME ()->kboard;
if (current_kboard == kb)
abort ();
}
wipe_kboard (kb);
xfree (kb);
}
#endif
#endif /* MULTI_KBOARD */
void
init_keyboard ()