# HG changeset patch # User ben # Date 992914177 0 # Node ID 16ff693bd7681e025a6fdc8124bc2591e1190518 # Parent af57a77cbc9288004e12e39911d433bcbbe4d808 [xemacs-hg @ 2001-06-19 01:29:35 by ben] window.c: We can't actually zero out everything in the window when deleting it. set-window-configuration assumes that various slots of the deleted window are still accurate. diff -r af57a77cbc92 -r 16ff693bd768 src/ChangeLog --- a/src/ChangeLog Mon Jun 18 07:10:32 2001 +0000 +++ b/src/ChangeLog Tue Jun 19 01:29:37 2001 +0000 @@ -1,3 +1,12 @@ +2001-06-18 Ben Wing + + * window.c: + * window.c (mark_window_as_deleted): + * window.c (WINDOW_SLOT): + We can't actually zero out everything in the window when deleting + it. set-window-configuration assumes that various slots of the + deleted window are still accurate. + 2001-06-17 Ben Wing --------------------------------------------------------------- diff -r af57a77cbc92 -r 16ff693bd768 src/window.c --- a/src/window.c Mon Jun 18 07:10:32 2001 +0000 +++ b/src/window.c Tue Jun 19 01:29:37 2001 +0000 @@ -1942,10 +1942,22 @@ reinitialized by the window-configuration code as necessary. */ finalize_window ((void *) w, 0); - /* Nobody should be accessing anything in this object any more, and - making them Qnil allows for better GC'ing in case a pointer to - the dead window continues to hang around. Zero all other structs - in case someone tries to access something through them. + /* "Nobody should be accessing anything in this object any more...", + I said, but unfortunately that's not quite true. + set-window-configuration undeletes the window and relies on + certain items to be there already. Fuckme! we really should + rewrite it in Lisp and just recreate the windows. (But does any + code depend on the pointers being the same? At the very least, + we should reinit everything in the window.) + + Nobody should be accessing anything in this object any more, + and making them Qnil allows for better GC'ing in case a pointer + to the dead window continues to hang around. Zero all other + structs in case someone tries to access something through them. + + (So, in point of fact, we zero out all of the "saved" slots, + which are obviously restored from the window config, plus the + slots which were already zeroed.) As an example of why setting the values to Qnil is good, here is an old comment: @@ -1963,11 +1975,17 @@ window-config data), we set them all to nil so that we are able to collect more actual garbage. */ - zero_lcrecord (w); - -#define WINDOW_SLOT(slot) w->slot = Qnil; +#define WINDOW_SLOT(slot) +#define WINDOW_SAVED_SLOT(slot, compare) w->slot = Qnil; #include "winslots.h" + w->next = Qnil; + w->prev = Qnil; + w->hchild = Qnil; + w->vchild = Qnil; + w->parent = Qnil; + w->subwindow_instance_cache = Qnil; + w->dead = 1; }