mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-18 22:26:05 +00:00
fixed node-pty conpty assertion failure - fixes #10618
This commit is contained in:
29
app/patches/node-pty+1.1.0-beta9.patch
Normal file
29
app/patches/node-pty+1.1.0-beta9.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
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");
|
||||
+ }
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user