We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 565da89 commit e240ec2Copy full SHA for e240ec2
contacts.mm
@@ -1,3 +1,4 @@
1
+#include "node.h"
2
#import <AppKit/AppKit.h>
3
#import <Contacts/Contacts.h>
4
#include <napi.h>
@@ -736,6 +737,10 @@ CNAuthorizationStatus AuthStatus() {
736
737
exports.Set(Napi::String::New(env, "updateContact"),
738
Napi::Function::New(env, UpdateContact));
739
740
+ auto *isolate = v8::Isolate::GetCurrent();
741
+ node::AddEnvironmentCleanupHook(
742
+ isolate, [](void *) { contacts_ref.Reset(); }, isolate);
743
+
744
return exports;
745
}
746
0 commit comments