diff options
author | Anna Henningsen <anna@addaleax.net> | 2017-04-27 12:47:47 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2017-04-29 17:19:59 +0200 |
commit | d5db4d25dc675e52f0ee7159321ef3bbea594a4d (patch) | |
tree | ebc1771c1e448d22f59c2909dbb705a7be8dec6b /test/cctest | |
parent | 427cd293d593511f3f592f3bcf99b0f4b4900fda (diff) | |
download | node-new-d5db4d25dc675e52f0ee7159321ef3bbea594a4d.tar.gz |
test: cleanup handles in test_environment
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: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'test/cctest')
-rw-r--r-- | test/cctest/test_environment.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc index a7579ac116..79bfbf50b4 100644 --- a/test/cctest/test_environment.cc +++ b/test/cctest/test_environment.cc @@ -42,6 +42,7 @@ class EnvironmentTest : public NodeTestFixture { ~Env() { FreeIsolateData(isolate_data_); + environment_->CleanupHandles(); FreeEnvironment(environment_); } |