1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-14 22:37:12 +00:00

Add TerminateProcess to janet_proc_gc and os_proc_kill on Windows

This commit is contained in:
Andrew Owen
2021-07-11 03:21:55 -06:00
parent 87f8fe14dd
commit 12cfda1f58
2 changed files with 7 additions and 0 deletions

View File

@@ -434,6 +434,7 @@ static int janet_proc_gc(void *p, size_t s) {
JanetProc *proc = (JanetProc *) p;
#ifdef JANET_WINDOWS
if (!(proc->flags & JANET_PROC_CLOSED)) {
TerminateProcess(proc->pHandle, 1);
CloseHandle(proc->pHandle);
CloseHandle(proc->tHandle);
}
@@ -519,6 +520,7 @@ static Janet os_proc_kill(int32_t argc, Janet *argv) {
janet_panicf("cannot close process handle that is already closed");
}
proc->flags |= JANET_PROC_CLOSED;
TerminateProcess(proc->pHandle, 1);
CloseHandle(proc->pHandle);
CloseHandle(proc->tHandle);
#else