If nhwindows_hangup() were to get called a second time, it would have
saved hup_exit_nhwindows() as the previous interface's shutdown routine.
Then if/when exit_nhwindows() gets called, hup_exit_nhwindows() would
have called itself with uncontrolled recursion. So guard against that by
preventing the hangup shutdown routine from ever being saved as previous
interface shutdown routine.
Also, avoid the exit_windows macro when using it as a pointer rather
than for a function call, since pre-ANSI compilers might be confused by
its expansion.
/* don't call exit_nhwindows() directly here; if a hangup occurs
while interface code is executing, exit_nhwindows could knock
the interface's active data structures out from under itself */
- if (iflags.window_inited)
- previnterface_exit_nhwindows = exit_nhwindows;
+ if (iflags.window_inited &&
+ windowprocs.win_exit_nhwindows != hup_exit_nhwindows)
+ previnterface_exit_nhwindows = windowprocs.win_exit_nhwindows;
windowprocs = hup_procs;
}