pdfium-native 0.5.5 → 0.5.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/package.json +2 -2
- package/src/pdfium_addon.cc +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pdfium-native",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "Native Node.js bindings for PDFium",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"eslint-plugin-prettier": "^5.5.5",
|
|
96
96
|
"husky": "^9.1.7",
|
|
97
97
|
"lint-staged": "^16.4.0",
|
|
98
|
-
"node-gyp": "^
|
|
98
|
+
"node-gyp": "^13.0.0",
|
|
99
99
|
"prettier": "^3.8.1",
|
|
100
100
|
"typescript": "^5.9.3",
|
|
101
101
|
"typescript-eslint": "^8.57.2",
|
package/src/pdfium_addon.cc
CHANGED
|
@@ -398,11 +398,11 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) {
|
|
|
398
398
|
env.SetInstanceData(addonData);
|
|
399
399
|
auto envAlive = addonData->envAlive;
|
|
400
400
|
|
|
401
|
-
// Layer 2: cleanup hook — fires during RunCleanup() after uv drain
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
});
|
|
401
|
+
// Layer 2: cleanup hook — fires during RunCleanup() after uv drain.
|
|
402
|
+
// SetInstanceData already installs a finalizer that deletes addonData on env
|
|
403
|
+
// teardown, so the hook must NOT delete it again (double free); it only flips
|
|
404
|
+
// the alive flag.
|
|
405
|
+
env.AddCleanupHook([addonData]() { addonData->envAlive->store(false); });
|
|
406
406
|
|
|
407
407
|
if (g_pdfium_refcount.fetch_add(1) == 0) {
|
|
408
408
|
FPDF_InitLibrary();
|