Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions test/cctest/node_test_fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class NodeTestFixture : public ::testing::Test {
ArrayBufferAllocator allocator_;
v8::Isolate* isolate_;

NodeTestFixture() : isolate_(nullptr), platform_(nullptr) {}

virtual void SetUp() {
platform_ = v8::platform::CreateDefaultPlatform();
v8::V8::InitializePlatform(platform_);
Expand All @@ -88,6 +90,8 @@ class NodeTestFixture : public ::testing::Test {
}

virtual void TearDown() {
isolate_->Dispose();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danbev Was the isolate being leaked? Is the dispose needed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it looks like it is currently being leaked. I think dispose is needed or at least I don't think it hurts to have it.

I'm not familiar with Coverity. Is there a way to get this at this information so I can try to clean up any future mess I create? I've looked at https://scan.coverity.com/projects/node-js, but can't really get to much information, I've requested to be added to the project so perhaps once that is approved I might be able to see some more details.

Sorry about this and thanks for fixing it.

isolate_ = nullptr;
v8::V8::ShutdownPlatform();
delete platform_;
platform_ = nullptr;
Expand Down