diff --git a/package.json b/package.json index 88215f5..11c38f0 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "64", "napi" ], - "version": "3.0.6", + "version": "3.0.7", "license": "MIT", "author": "Anna Henningsen ", "maintainers": [ diff --git a/src/binding.cc b/src/binding.cc index 7e91215..352ec7f 100644 --- a/src/binding.cc +++ b/src/binding.cc @@ -106,12 +106,12 @@ class InstanceData final : public RefNapi::Instance { auto it = pointer_to_orig_buffer.find(ptr); if (it != pointer_to_orig_buffer.end()) { + it->second.finalizer_count++; if (!it->second.ab.Value().IsEmpty()) { // Already have a valid entry, nothing to do. return; } it->second.ab.Reset(buf, 0); - it->second.finalizer_count++; } else { pointer_to_orig_buffer.emplace(ptr, ArrayBufferEntry { Reference::New(buf, 0),