--- ray/src/rt/rview.c 2008/09/05 19:45:42 2.31 +++ ray/src/rt/rview.c 2009/12/12 23:08:13 2.33 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rview.c,v 2.31 2008/09/05 19:45:42 greg Exp $"; +static const char RCSid[] = "$Id: rview.c,v 2.33 2009/12/12 23:08:13 greg Exp $"; #endif /* * rview.c - routines and variables for interactive view generation. @@ -16,6 +16,22 @@ static const char RCSid[] = "$Id: rview.c,v 2.31 2008/ #include "rpaint.h" #define CTRL(c) ((c)-'@') + + +void +quit(code) /* quit program */ +int code; +{ +#ifdef MSTATS + if (code == 2 && errno == ENOMEM) + printmemstats(stderr); +#endif + if (ray_pnprocs > 0) /* close children if any */ + ray_pclose(0); + else if (!ray_pnprocs) /* in parent */ + devclose(); + exit(code); +} void