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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user