Skip to content

Commit

Permalink
test: cleanup handles in test_environment
Browse files Browse the repository at this point in the history
The test fixtures create multiple node::Environments that all use the
uv_default_loop(), and since the test does not clean up the handles
created by Environment::Start(), the default libuv loop structure
contains dangling pointers after the first Environment is freed,
which then means that creating new handles leads to memory corruption.

PR-URL: #12621
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
addaleax committed Apr 29, 2017
1 parent 427cd29 commit d5db4d2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/cctest/test_environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class EnvironmentTest : public NodeTestFixture {

~Env() {
FreeIsolateData(isolate_data_);
environment_->CleanupHandles();
FreeEnvironment(environment_);
}

Expand Down

0 comments on commit d5db4d2

Please sign in to comment.