Skip to content

Commit

Permalink
src: call CleanupHandles in FreeEnvironment
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
joyeecheung authored and addaleax committed Mar 15, 2018
1 parent c6ae8a2 commit 855dabd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4405,6 +4405,7 @@ Environment* CreateEnvironment(IsolateData* isolate_data,


void FreeEnvironment(Environment* env) {
env->CleanupHandles();
delete env;
}

Expand Down
1 change: 0 additions & 1 deletion test/cctest/node_test_fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ class EnvironmentTestFixture : public NodeTestFixture {
}

~Env() {
environment_->CleanupHandles();
node::FreeEnvironment(environment_);
node::FreeIsolateData(isolate_data_);
context_->Exit();
Expand Down

0 comments on commit 855dabd

Please sign in to comment.