Skip to content

Commit 855dabd

Browse files
joyeecheungaddaleax
authored andcommitted
src: call CleanupHandles in FreeEnvironment
CleanupHandles() has not been called in our own code base anymore after the v8 debug agent has been removed. It used to be in the ~Environment() destructor but then removed to avoid firing other events after the exit event, given that we were not going to clean up handles for the one environment per process setup. Call it in FreeEnvironment so that embedders can clean up the handles in the loop when creating multiple environments. PR-URL: #19319 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jackson Tian <shyvo1987@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent c6ae8a2 commit 855dabd

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

src/node.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4405,6 +4405,7 @@ Environment* CreateEnvironment(IsolateData* isolate_data,
44054405

44064406

44074407
void FreeEnvironment(Environment* env) {
4408+
env->CleanupHandles();
44084409
delete env;
44094410
}
44104411

test/cctest/node_test_fixture.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ class EnvironmentTestFixture : public NodeTestFixture {
118118
}
119119

120120
~Env() {
121-
environment_->CleanupHandles();
122121
node::FreeEnvironment(environment_);
123122
node::FreeIsolateData(isolate_data_);
124123
context_->Exit();

0 commit comments

Comments
 (0)