This is the mail archive of the guile@cygnus.com mailing list for the guile project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
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