koffi 2.15.5 → 2.15.6

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/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@
7
7
 
8
8
  ### Koffi 2.15
9
9
 
10
+ #### Koffi 2.15.6
11
+
12
+ *Released on 2026-04-07*
13
+
14
+ - Fix possile exit crash after using `koffi.reset()` (introduced in Koffi 2.15.2)
15
+
10
16
  #### Koffi 2.15.5
11
17
 
12
18
  *Released on 2026-04-05*
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/index.js CHANGED
@@ -398,7 +398,7 @@ var require_package = __commonJS({
398
398
  "../../../bin/Koffi/package/src/koffi/package.json"(exports2, module2) {
399
399
  module2.exports = {
400
400
  name: "koffi",
401
- version: "2.15.5",
401
+ version: "2.15.6",
402
402
  description: "Fast and simple C FFI (foreign function interface) for Node.js",
403
403
  keywords: [
404
404
  "foreign",
package/indirect.js CHANGED
@@ -398,7 +398,7 @@ var require_package = __commonJS({
398
398
  "../../../bin/Koffi/package/src/koffi/package.json"(exports2, module2) {
399
399
  module2.exports = {
400
400
  name: "koffi",
401
- version: "2.15.5",
401
+ version: "2.15.6",
402
402
  description: "Fast and simple C FFI (foreign function interface) for Node.js",
403
403
  keywords: [
404
404
  "foreign",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koffi",
3
- "version": "2.15.5",
3
+ "version": "2.15.6",
4
4
  "description": "Fast and simple C FFI (foreign function interface) for Node.js",
5
5
  "keywords": [
6
6
  "foreign",
@@ -2364,11 +2364,6 @@ bool InitAsyncBroker(Napi::Env env, InstanceData *instance)
2364
2364
  return false;
2365
2365
  }
2366
2366
  napi_unref_threadsafe_function(env, instance->broker);
2367
-
2368
- napi_add_env_cleanup_hook(env, [](void *udata) {
2369
- napi_threadsafe_function broker = (napi_threadsafe_function)udata;
2370
- napi_release_threadsafe_function(broker, napi_tsfn_abort);
2371
- }, instance->broker);
2372
2367
  }
2373
2368
 
2374
2369
  return true;
@@ -2630,6 +2625,17 @@ static Napi::Object InitModule(Napi::Env env, Napi::Object exports)
2630
2625
 
2631
2626
  exports.Set("version", Napi::String::New(env, K_STRINGIFY(VERSION)));
2632
2627
 
2628
+ napi_add_env_cleanup_hook(env, [](void *udata) {
2629
+ InstanceData *instance = (InstanceData *)udata;
2630
+
2631
+ if (instance->broker) {
2632
+ // This deadlocks if we try to do this when the module is destroyed, when
2633
+ // the InstanceData destructor runs, so run in the env cleanup hook instead,
2634
+ // where it seems to go okay.
2635
+ napi_release_threadsafe_function(instance->broker, napi_tsfn_abort);
2636
+ }
2637
+ }, instance);
2638
+
2633
2639
  return exports;
2634
2640
  }
2635
2641