Skip to content

Commit ca37665

Browse files
authored
ffi: move DynamicLibrary disposer to native layer
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk> PR-URL: #63459 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
1 parent 5ff701a commit ca37665

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

lib/ffi.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ const {
5656

5757
require('internal/ffi-shared-buffer');
5858

59-
DynamicLibrary.prototype[SymbolDispose] = function() {
60-
this.close();
61-
};
62-
6359
function checkFFIPermission() {
6460
if (!permission.isEnabled()) {
6561
return;

src/node_ffi.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,7 @@ Local<FunctionTemplate> DynamicLibrary::GetConstructorTemplate(
11021102
static_cast<PropertyAttribute>(ReadOnly));
11031103

11041104
SetProtoMethod(isolate, tmpl, "close", DynamicLibrary::Close);
1105+
SetProtoDispose(isolate, tmpl, DynamicLibrary::Close);
11051106
SetProtoMethod(isolate, tmpl, "getFunction", DynamicLibrary::GetFunction);
11061107
SetProtoMethod(isolate, tmpl, "getFunctions", DynamicLibrary::GetFunctions);
11071108
SetProtoMethod(isolate, tmpl, "getSymbol", DynamicLibrary::GetSymbol);

0 commit comments

Comments
 (0)