File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -372,6 +372,9 @@ class Reference : public RefBase {
372372
373373 protected:
374374 inline void Finalize (bool is_env_teardown = false ) override {
375+ if (is_env_teardown) env_teardown_finalize_started_ = true ;
376+ if (!is_env_teardown && env_teardown_finalize_started_) return ;
377+
375378 // During env teardown, `~napi_env()` alone is responsible for finalizing.
376379 // Thus, we don't want any stray gc passes to trigger a second call to
377380 // `Finalize()`, so let's reset the persistent here if nothing is
@@ -405,6 +408,7 @@ class Reference : public RefBase {
405408 data.GetParameter ()->Finalize ();
406409 }
407410
411+ bool env_teardown_finalize_started_ = false ;
408412 v8impl::Persistent<v8::Value> _persistent;
409413};
410414
You can’t perform that action at this time.
0 commit comments