node-pty+1.1.0-beta9.patch 957 B

1234567891011121314151617181920212223242526272829
  1. diff --git a/node_modules/node-pty/src/win/conpty.cc b/node_modules/node-pty/src/win/conpty.cc
  2. index c41796c..08c6439 100644
  3. --- a/node_modules/node-pty/src/win/conpty.cc
  4. +++ b/node_modules/node-pty/src/win/conpty.cc
  5. @@ -107,9 +107,22 @@ void SetupExitCallback(Napi::Env env, Napi::Function cb, pty_baton* baton) {
  6. CloseHandle(baton->hOut);
  7. auto status = tsfn.BlockingCall(exit_event, callback); // In main thread
  8. - assert(status == napi_ok);
  9. + switch (status) {
  10. + case napi_closing:
  11. + break;
  12. - tsfn.Release();
  13. + case napi_queue_full:
  14. + Napi::Error::Fatal("SetupExitCallback", "Queue was full");
  15. +
  16. + case napi_ok:
  17. + if (tsfn.Release() != napi_ok) {
  18. + Napi::Error::Fatal("SetupExitCallback", "ThreadSafeFunction.Release() failed");
  19. + }
  20. + break;
  21. +
  22. + default:
  23. + Napi::Error::Fatal("SetupExitCallback", "ThreadSafeFunction.BlockingCall() failed");
  24. + }
  25. });
  26. }