@@ -36,10 +36,12 @@ void SetPasswordWorker::Execute() {
3636}
3737
3838void SetPasswordWorker::OnOK () {
39+ Napi::HandleScope scope (Env ());
3940 deferred.Resolve (Env ().Undefined ());
4041}
4142
4243void SetPasswordWorker::OnError (Napi::Error const &error) {
44+ Napi::HandleScope scope (Env ());
4345 deferred.Reject (error.Value ());
4446}
4547
@@ -75,6 +77,7 @@ void GetPasswordWorker::Execute() {
7577}
7678
7779void GetPasswordWorker::OnOK () {
80+ Napi::HandleScope scope (Env ());
7881 Napi::Value val = Env ().Null ();
7982 if (success) {
8083 val = Napi::String::New (Env (), password.data (),
@@ -84,6 +87,7 @@ void GetPasswordWorker::OnOK() {
8487}
8588
8689void GetPasswordWorker::OnError (Napi::Error const &error) {
90+ Napi::HandleScope scope (Env ());
8791 deferred.Reject (error.Value ());
8892}
8993
@@ -115,10 +119,12 @@ void DeletePasswordWorker::Execute() {
115119}
116120
117121void DeletePasswordWorker::OnOK () {
122+ Napi::HandleScope scope (Env ());
118123 deferred.Resolve (Napi::Boolean::New (Env (), success));
119124}
120125
121126void DeletePasswordWorker::OnError (Napi::Error const &error) {
127+ Napi::HandleScope scope (Env ());
122128 deferred.Reject (error.Value ());
123129}
124130
@@ -150,6 +156,7 @@ void FindPasswordWorker::Execute() {
150156}
151157
152158void FindPasswordWorker::OnOK () {
159+ Napi::HandleScope scope (Env ());
153160 Napi::Value val = Env ().Null ();
154161 if (success) {
155162 val = Napi::String::New (Env (), password.data (),
@@ -159,6 +166,7 @@ void FindPasswordWorker::OnOK() {
159166}
160167
161168void FindPasswordWorker::OnError (Napi::Error const &error) {
169+ Napi::HandleScope scope (Env ());
162170 deferred.Reject (error.Value ());
163171}
164172
@@ -190,6 +198,7 @@ void FindCredentialsWorker::Execute() {
190198}
191199
192200void FindCredentialsWorker::OnOK () {
201+ Napi::HandleScope scope (Env ());
193202 Napi::Env env = Env ();
194203
195204 if (success) {
@@ -228,5 +237,6 @@ void FindCredentialsWorker::OnOK() {
228237}
229238
230239void FindCredentialsWorker::OnError (Napi::Error const &error) {
240+ Napi::HandleScope scope (Env ());
231241 deferred.Reject (error.Value ());
232242}
0 commit comments