Skip to content

Commit d5db4d2

Browse files
committed
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: #12621 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 427cd29 commit d5db4d2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/cctest/test_environment.cc

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class EnvironmentTest : public NodeTestFixture {
4242

4343
~Env() {
4444
FreeIsolateData(isolate_data_);
45+
environment_->CleanupHandles();
4546
FreeEnvironment(environment_);
4647
}
4748

0 commit comments

Comments
 (0)