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.
@@ -223,10 +223,18 @@ Agent::Agent(LPCWSTR controlPipeName,
223
223
 
224
224
  Agent::~Agent()
225
225
  {
226
- trace("Agent::~Agent entered");
227
- agentShutdown();
228
- if (m_childProcess != NULL) {
229
- CloseHandle(m_childProcess);
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
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Microsoft Corporation"
6
6
  },
7
- "version": "1.1.0-beta22",
7
+ "version": "1.1.0-beta24",
8
8
  "license": "MIT",
9
9
  "main": "./lib/index.js",
10
10
  "types": "./typings/node-pty.d.ts",
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