fix reported crash of TTY_PERM_INVENT segfaulting
Options processing can be early, even before ttyDisplay is allocated. If we find that TTY_PERM_INVENT initialization is happening too early, just set a marker (iflags.perm_invent_pending) to try again a bit later. The changes in win/share are just to be able to sucessfully reproduce the original issue on Windows. It was easily reproduced on Unix, just by building with TTY_PERM_INVENT in include/config.h and setting OPTIONS=perm_invent in config file.
This commit is contained in:
@@ -510,13 +510,23 @@ safe_update_inventory(int arg UNUSED)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef WIN32CON
|
||||
extern win_request_info *tty_ctrl_nhwindow(winid window UNUSED,
|
||||
int request UNUSED,
|
||||
win_request_info *wri UNUSED);
|
||||
#endif
|
||||
|
||||
win_request_info *
|
||||
safe_ctrl_nhwindow(
|
||||
winid window UNUSED,
|
||||
int request UNUSED,
|
||||
win_request_info *wri UNUSED)
|
||||
{
|
||||
#ifdef WIN32CON
|
||||
return (*tty_ctrl_nhwindow)(window, request, wri);
|
||||
#else
|
||||
return (win_request_info *) 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
|
||||
Reference in New Issue
Block a user