mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-05 18:13:38 +00:00
Updated server finalizer, so it cleans up named pipe, if its an IPC server.
This commit is contained in:
@@ -1251,6 +1251,17 @@ duk_ret_t ILibDuktape_net_server_Finalizer(duk_context *ctx)
|
||||
ILibAsyncServerSocket_RemoveFromChain(server->server);
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
ILibDuktape_net_WindowsIPC *ipc = Duktape_GetBufferProperty(ctx, 0, ILibDuktape_net_WindowsIPC_Buffer);
|
||||
if (ipc != NULL && ipc->mPipeHandle != NULL && ipc->overlapped.hEvent != NULL)
|
||||
{
|
||||
ILibProcessPipe_WaitHandle_Remove(ipc->manager, ipc->overlapped.hEvent);
|
||||
CloseHandle(ipc->mPipeHandle);
|
||||
CloseHandle(ipc->overlapped.hEvent);
|
||||
ipc->overlapped.hEvent = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
duk_ret_t ILibDuktape_net_server_address(duk_context *ctx)
|
||||
|
||||
Reference in New Issue
Block a user