Skip to content

Commit c21109c

Browse files
authored
Merge pull request #25 from wasmerio/napi_qjs_teardown_issues
napi_refs teardown fix
2 parents 84ca277 + 125a201 commit c21109c

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎quickjs/src/internal/napi_env.cc‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,8 @@ void napi_env__::prepare_teardown()
7676

7777
void napi_env__::clear_refs_for_teardown()
7878
{
79-
while (napi_ref__ *ref = refs_.take_next_used())
80-
{
81-
ref->clear_for_teardown();
82-
ref->~napi_ref__();
83-
}
79+
for (napi_ref__ &ref : refs_)
80+
ref.clear_for_teardown();
8481
}
8582

8683
void napi_env__::finalize_instance_data()

0 commit comments

Comments
 (0)