| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -372,6 +372,9 @@ class Reference : public RefBase { | |||
| 372 | 372 | ||
| 373 | 373 | protected: | |
| 374 | 374 | 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 | + | ||
| 375 | 378 | // During env teardown, `~napi_env()` alone is responsible for finalizing. | |
| 376 | 379 | // Thus, we don't want any stray gc passes to trigger a second call to | |
| 377 | 380 | // `Finalize()`, so let's reset the persistent here if nothing is | |
@@ -405,6 +408,7 @@ class Reference : public RefBase { | |||
| 405 | 408 | data.GetParameter()->Finalize(); | |
| 406 | 409 | } | |
| 407 | 410 | ||
| 411 | + bool env_teardown_finalize_started_ = false; | ||
| 408 | 412 | v8impl::Persistent<v8::Value> _persistent; | |
| 409 | 413 | }; | |
| 410 | 414 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments