diff --git a/microscript/ILibDuktape_ChildProcess.c b/microscript/ILibDuktape_ChildProcess.c index 41e331a..9e2ef3d 100644 --- a/microscript/ILibDuktape_ChildProcess.c +++ b/microscript/ILibDuktape_ChildProcess.c @@ -194,8 +194,9 @@ duk_ret_t ILibDuktape_ChildProcess_waitExit(duk_context *ctx) duk_ret_t ILibDuktape_ChildProcess_SpawnedProcess_Finalizer(duk_context *ctx) { ILibDuktape_ChildProcess_SubProcess *retVal = (ILibDuktape_ChildProcess_SubProcess*)Duktape_GetBufferProperty(ctx, 0, ILibDuktape_ChildProcess_MemBuf); +#ifdef WIN32 ILibProcessPipe_Process_RemoveHandlers(retVal->childProcess); - +#endif duk_get_prop_string(ctx, 0, "kill"); // [kill] duk_dup(ctx, 0); // [kill][this] duk_call_method(ctx, 0); diff --git a/microstack/ILibProcessPipe.c b/microstack/ILibProcessPipe.c index 5211638..da4edf7 100644 --- a/microstack/ILibProcessPipe.c +++ b/microstack/ILibProcessPipe.c @@ -1628,6 +1628,7 @@ void ILibProcessPipe_Process_UpdateUserObject(ILibProcessPipe_Process module, vo { ((ILibProcessPipe_Process_Object*)module)->userObject = userObj; } +#ifdef WIN32 void ILibProcessPipe_Process_RemoveHandlers(ILibProcessPipe_Process module) { ILibProcessPipe_Process_Object* j = (ILibProcessPipe_Process_Object*)module; @@ -1637,6 +1638,7 @@ void ILibProcessPipe_Process_RemoveHandlers(ILibProcessPipe_Process module) ILibProcessPipe_WaitHandle_Remove(j->parent, j->hProcess); } } +#endif void ILibProcessPipe_Process_AddHandlers(ILibProcessPipe_Process module, int bufferSize, ILibProcessPipe_Process_ExitHandler exitHandler, ILibProcessPipe_Process_OutputHandler stdOut, ILibProcessPipe_Process_OutputHandler stdErr, ILibProcessPipe_Process_SendOKHandler sendOk, void *user) { ILibProcessPipe_Process_Object* j = (ILibProcessPipe_Process_Object*)module; diff --git a/microstack/ILibProcessPipe.h b/microstack/ILibProcessPipe.h index 6ae6846..a4de7d0 100644 --- a/microstack/ILibProcessPipe.h +++ b/microstack/ILibProcessPipe.h @@ -80,7 +80,9 @@ ILibProcessPipe_Process ILibProcessPipe_Manager_SpawnProcessEx4(ILibProcessPipe_ #define ILibProcessPipe_Manager_SpawnProcessWithExtraPipeMemory(pipeManager, target, parameters, memorySize) ILibProcessPipe_Manager_SpawnProcessEx2(pipeManager, target, parameters, ILibProcessPipe_SpawnTypes_DEFAULT, memorySize) void ILibProcessPipe_Process_SoftKill(ILibProcessPipe_Process p); void ILibProcessPipe_Process_AddHandlers(ILibProcessPipe_Process module, int bufferSize, ILibProcessPipe_Process_ExitHandler exitHandler, ILibProcessPipe_Process_OutputHandler stdOut, ILibProcessPipe_Process_OutputHandler stdErr, ILibProcessPipe_Process_SendOKHandler sendOk, void *user); +#ifdef WIN32 void ILibProcessPipe_Process_RemoveHandlers(ILibProcessPipe_Process module); +#endif void ILibProcessPipe_Process_UpdateUserObject(ILibProcessPipe_Process module, void *userObj); ILibTransport_DoneState ILibProcessPipe_Process_WriteStdIn(ILibProcessPipe_Process p, char* buffer, int bufferLen, ILibTransport_MemoryOwnership ownership); void ILibProcessPipe_Process_CloseStdIn(ILibProcessPipe_Process p);