Asynchronous process reaping (#1412)

* refactor(process): introduce process_stream_handle separate from process_handle

* feat(process): introduce process_handle helper functions

* feat(process): add asynchronous process reaping

* feat(process): wait for shorter period if possible

* style(process): remove unecessary brackets

* style(process): fix parentheses

* refactor(process): remove useless setvbuf call

* style(process): remove unecessary value

* refactor(process): add size field into kill_list

* refactor(process): use SDL_Delay for sleeping

* style(process): remove trailing whitespace

* fix(main): destroy window before closing lua

* fix(process): check for timeout correctly

* refactor(process): remove unecessary if check

* refactor(process): remove size from the list

* fix(process): fix invalid delay calculation

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>

---------

Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
This commit is contained in:
Takase
2023-08-19 12:38:49 +08:00
committed by takase1121
co-authored by Guldoman
parent 89864ee88c
commit 84c7bb9de6
2 changed files with 262 additions and 54 deletions
+3 -1
View File
@@ -255,8 +255,10 @@ init_lua:
goto init_lua;
}
lua_close(L);
// This allows the window to be destroyed before lite-xl is done with
// reaping child processes
ren_free_window_resources(&window_renderer);
lua_close(L);
return EXIT_SUCCESS;
}