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 d00b101 commit 06d995eCopy full SHA for 06d995e
src/node/async_context_releaser.cc
@@ -28,16 +28,19 @@ void AsyncContextReleaser::Execute(Napi::Env env) {
28
}
29
30
AsyncContextReleaser* AsyncContextReleaser::GetDefault() {
31
+ if (!_default) {
32
+ Napi::HandleScope scope(constructor().Env());
33
+ auto object = constructor().New({});
34
+ _default = Unwrap(object);
35
+ _default->Ref();
36
+ }
37
return _default;
38
39
40
void AsyncContextReleaser::Init(Napi::Env env, Napi::Object) {
41
auto func = DefineClass(env, "AsyncContextReleaser", {});
42
constructor() = Napi::Persistent(func);
43
constructor().SuppressDestruct();
- auto object = constructor().New({});
- _default = Unwrap(object);
- _default->Ref();
44
45
46
} // namespace node_webrtc
0 commit comments