one bug down in ncguile

Klaus Schilling (Klaus.Schilling@home.ivm.de)
Fri, 14 Aug 1998 18:52:05 +0200 (MET DST)

I revised the mark and kill function for my win smobs in the guile bindings
for ncurses , and the test script doesn't cause a crash anymore.
These are the revised functions for controlling the garbage collection of
window smobs:

SCM
win_mark (SCM obj)
{
WINDOW *win;
win = (WINDOW *) SCM_CDR (obj);
/* SCM_SETGC8MARK (win); now obsolete ? */
if (_SUBWIN & ((win)->_flags))
{
SCM_SETGC8MARK (win2scm ((win)->_parent));
}
return SCM_BOOL_F;
}
/* Jaffer doesn't enforce marking parent windows of subwindows. Wonder if
there's something else that prevents orphanization of windows */

scm_sizet
win_die (SCM obj)
{
WINDOW *win;
win = (WINDOW *) SCM_CDR (obj);
if ((win == stdscr) || (win == curscr))
{
return 0;
} /* do not garbage collect stdscr or curscr */
return ((delwin (win) == ERR) ? 0 : sizeof (WINDOW));

/* Jaffer lets always return 0 , wonder why */

}

Klaus Schilling