node-pty 1.1.0-beta22 → 1.1.0-beta24
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/deps/winpty/src/agent/Agent.cc +12 -4
- package/package.json +1 -1
- package/src/win/conpty.cc +3 -0
|
@@ -223,10 +223,18 @@ Agent::Agent(LPCWSTR controlPipeName,
|
|
|
223
223
|
|
|
224
224
|
Agent::~Agent()
|
|
225
225
|
{
|
|
226
|
-
trace("Agent::~
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
trace("Agent::~Aent entered");
|
|
227
|
+
try {
|
|
228
|
+
agentShutdown();
|
|
229
|
+
if (m_childProcess != NULL) {
|
|
230
|
+
CloseHandle(m_childProcess);
|
|
231
|
+
}
|
|
232
|
+
} catch (const std::exception &e) {
|
|
233
|
+
// Log the exception or handle it as needed
|
|
234
|
+
trace("Exception in Agent::~Agent: %s", e.what());
|
|
235
|
+
} catch (...) {
|
|
236
|
+
// Catch any other types of exceptions
|
|
237
|
+
trace("Unknown exception in Agent::~Agent");
|
|
230
238
|
}
|
|
231
239
|
}
|
|
232
240
|
|
package/package.json
CHANGED
package/src/win/conpty.cc
CHANGED
|
@@ -429,6 +429,9 @@ static Napi::Value PtyConnect(const Napi::CallbackInfo& info) {
|
|
|
429
429
|
// Update handle
|
|
430
430
|
handle->hShell = piClient.hProcess;
|
|
431
431
|
|
|
432
|
+
// Close the thread handle to avoid resource leak
|
|
433
|
+
CloseHandle(piClient.hThread);
|
|
434
|
+
|
|
432
435
|
SetupExitCallback(env, exitCallback, handle);
|
|
433
436
|
|
|
434
437
|
// Return
|