| 1234567891011121314151617181920212223242526272829 |
- diff --git a/node_modules/node-pty/src/win/conpty.cc b/node_modules/node-pty/src/win/conpty.cc
- index c41796c..08c6439 100644
- --- a/node_modules/node-pty/src/win/conpty.cc
- +++ b/node_modules/node-pty/src/win/conpty.cc
- @@ -107,9 +107,22 @@ void SetupExitCallback(Napi::Env env, Napi::Function cb, pty_baton* baton) {
- CloseHandle(baton->hOut);
-
- auto status = tsfn.BlockingCall(exit_event, callback); // In main thread
- - assert(status == napi_ok);
- + switch (status) {
- + case napi_closing:
- + break;
-
- - tsfn.Release();
- + case napi_queue_full:
- + Napi::Error::Fatal("SetupExitCallback", "Queue was full");
- +
- + case napi_ok:
- + if (tsfn.Release() != napi_ok) {
- + Napi::Error::Fatal("SetupExitCallback", "ThreadSafeFunction.Release() failed");
- + }
- + break;
- +
- + default:
- + Napi::Error::Fatal("SetupExitCallback", "ThreadSafeFunction.BlockingCall() failed");
- + }
- });
- }
-
|