| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent de608c3 commit d1e1dbf
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,7 +30,10 @@ void AtExit(Environment* env, void (*cb)(void* arg), void* arg) { | |||
| 30 | 30 | } | |
| 31 | 31 | ||
| 32 | 32 | void EmitBeforeExit(Environment* env) { | |
| 33 | - env->RunBeforeExitCallbacks(); | ||
| 33 | + TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), | ||
| 34 | + "BeforeExit", env); | ||
| 35 | + if (!env->destroy_async_id_list()->empty()) | ||
| 36 | + AsyncWrap::DestroyAsyncIdsCallback(env); | ||
| 34 | 37 | ||
| 35 | 38 | HandleScope handle_scope(env->isolate()); | |
| 36 | 39 | Context::Scope context_scope(env->context()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -373,13 +373,6 @@ Environment::Environment(IsolateData* isolate_data, | |||
| 373 | 373 | } | |
| 374 | 374 | ||
| 375 | 375 | destroy_async_id_list_.reserve(512); | |
| 376 | - BeforeExit( | ||
| 377 | - [](void* arg) { | ||
| 378 | - Environment* env = static_cast<Environment*>(arg); | ||
| 379 | - if (!env->destroy_async_id_list()->empty()) | ||
| 380 | - AsyncWrap::DestroyAsyncIdsCallback(env); | ||
| 381 | - }, | ||
| 382 | - this); | ||
| 383 | 376 | ||
| 384 | 377 | performance_state_ = | |
| 385 | 378 | std::make_unique<performance::PerformanceState>(isolate()); | |
@@ -677,19 +670,6 @@ void Environment::RunCleanup() { | |||
| 677 | 670 | } | |
| 678 | 671 | } | |
| 679 | 672 | ||
| 680 | - void Environment::RunBeforeExitCallbacks() { | ||
| 681 | - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), | ||
| 682 | - "BeforeExit", this); | ||
| 683 | - for (ExitCallback before_exit : before_exit_functions_) { | ||
| 684 | - before_exit.cb_(before_exit.arg_); | ||
| 685 | - } | ||
| 686 | - before_exit_functions_.clear(); | ||
| 687 | - } | ||
| 688 | - | ||
| 689 | - void Environment::BeforeExit(void (*cb)(void* arg), void* arg) { | ||
| 690 | - before_exit_functions_.push_back(ExitCallback{cb, arg}); | ||
| 691 | - } | ||
| 692 | - | ||
| 693 | 673 | void Environment::RunAtExitCallbacks() { | |
| 694 | 674 | TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), | |
| 695 | 675 | "AtExit", this); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1101,8 +1101,6 @@ class Environment : public MemoryRetainer { | |||
| 1101 | 1101 | const char* name, | |
| 1102 | 1102 | v8::FunctionCallback callback); | |
| 1103 | 1103 | ||
| 1104 | - void BeforeExit(void (*cb)(void* arg), void* arg); | ||
| 1105 | - void RunBeforeExitCallbacks(); | ||
| 1106 | 1104 | void AtExit(void (*cb)(void* arg), void* arg); | |
| 1107 | 1105 | void RunAtExitCallbacks(); | |
| 1108 | 1106 | ||
@@ -1359,7 +1357,6 @@ class Environment : public MemoryRetainer { | |||
| 1359 | 1357 | void (*cb_)(void* arg); | |
| 1360 | 1358 | void* arg_; | |
| 1361 | 1359 | }; | |
| 1362 | - std::list<ExitCallback> before_exit_functions_; | ||
| 1363 | 1360 | ||
| 1364 | 1361 | std::list<ExitCallback> at_exit_functions_; | |
| 1365 | 1362 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments