DavidKinder / Windows-Inform7

Front-end for the Windows version of Inform 7.
http://inform7.com/
Artistic License 2.0
70 stars 10 forks source link

CEF sub-processes occasionally remain if main process fails #26

Closed DavidKinder closed 3 years ago

DavidKinder commented 3 years ago

It has been observed for one or more CEF processes to remain after the main Inform7 process has failed. This should not happen since a Windows job is used to ensure that all sub-processes die when the Inform7 process exits. However, the job is created after CefExecuteProcess() is called, so there is a chance of the sub-processes being created before the job is created.

Really the job needs to be created before CefExecuteProcess(), but only in the main process. We should pass a command line parameter to the sub-processes so that the Inform7 code can distinguish whether it is running as a sub-process or not before CefExecuteProcess() is called.

DavidKinder commented 3 years ago

Fixed by c3be4c9f6423b7ebd12458076c61bdb309610ff1.

DavidKinder commented 3 years ago

This is still occasionally being seen. Questions:

  1. Do the worker processes actually get added to the Inform7 process' job?
  2. If not, can the code be changed to add them?
DavidKinder commented 3 years ago

Commit e420796c6bf5ae1d333744bcba431195e5888a9b adds code that hooks libcef's calls to CreateProcessW() and uses that hook to add such processes to the job object. This should really fix this once and for all.