node-pty 1.1.0-beta10 → 1.1.0-beta11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/unix/pty.cc +15 -2
- package/src/win/conpty.cc +15 -2
package/package.json
CHANGED
package/src/unix/pty.cc
CHANGED
|
@@ -189,9 +189,22 @@ void SetupExitCallback(Napi::Env env, Napi::Function cb, pid_t pid) {
|
|
|
189
189
|
exit_event->signal_code = WTERMSIG(stat_loc);
|
|
190
190
|
}
|
|
191
191
|
auto status = tsfn.BlockingCall(exit_event, callback); // In main thread
|
|
192
|
-
|
|
192
|
+
switch (status) {
|
|
193
|
+
case napi_closing:
|
|
194
|
+
break;
|
|
193
195
|
|
|
194
|
-
|
|
196
|
+
case napi_queue_full:
|
|
197
|
+
Napi::Error::Fatal("SetupExitCallback", "Queue was full");
|
|
198
|
+
|
|
199
|
+
case napi_ok:
|
|
200
|
+
if (tsfn.Release() != napi_ok) {
|
|
201
|
+
Napi::Error::Fatal("SetupExitCallback", "ThreadSafeFunction.Release() failed");
|
|
202
|
+
}
|
|
203
|
+
break;
|
|
204
|
+
|
|
205
|
+
default:
|
|
206
|
+
Napi::Error::Fatal("SetupExitCallback", "ThreadSafeFunction.BlockingCall() failed");
|
|
207
|
+
}
|
|
195
208
|
});
|
|
196
209
|
}
|
|
197
210
|
|
package/src/win/conpty.cc
CHANGED
|
@@ -107,9 +107,22 @@ void SetupExitCallback(Napi::Env env, Napi::Function cb, pty_baton* baton) {
|
|
|
107
107
|
CloseHandle(baton->hOut);
|
|
108
108
|
|
|
109
109
|
auto status = tsfn.BlockingCall(exit_event, callback); // In main thread
|
|
110
|
-
|
|
110
|
+
switch (status) {
|
|
111
|
+
case napi_closing:
|
|
112
|
+
break;
|
|
111
113
|
|
|
112
|
-
|
|
114
|
+
case napi_queue_full:
|
|
115
|
+
Napi::Error::Fatal("SetupExitCallback", "Queue was full");
|
|
116
|
+
|
|
117
|
+
case napi_ok:
|
|
118
|
+
if (tsfn.Release() != napi_ok) {
|
|
119
|
+
Napi::Error::Fatal("SetupExitCallback", "ThreadSafeFunction.Release() failed");
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
122
|
+
|
|
123
|
+
default:
|
|
124
|
+
Napi::Error::Fatal("SetupExitCallback", "ThreadSafeFunction.BlockingCall() failed");
|
|
125
|
+
}
|
|
113
126
|
});
|
|
114
127
|
}
|
|
115
128
|
|