Commit e0f21bb7 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[arm-simulator] Dispose stray Isolate in test

Bug: 
Change-Id: I6b853f9462793c14aca3cc45c735ddcef6ed6155
Reviewed-on: https://chromium-review.googlesource.com/704637
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48339}
parent e0d64dc6
......@@ -279,15 +279,16 @@ class MemoryAccessThread : public v8::base::Thread {
test_data_(NULL),
is_finished_(false),
has_request_(false),
did_request_(false) {}
did_request_(false),
isolate_(nullptr) {}
virtual void Run() {
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
v8::Isolate* isolate = v8::Isolate::New(create_params);
Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate);
v8::Isolate::Scope scope(isolate);
isolate_ = v8::Isolate::New(create_params);
Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate_);
{
v8::Isolate::Scope scope(isolate_);
v8::base::LockGuard<v8::base::Mutex> lock_guard(&mutex_);
while (!is_finished_) {
while (!(has_request_ || is_finished_)) {
......@@ -304,6 +305,8 @@ class MemoryAccessThread : public v8::base::Thread {
did_request_cv_.NotifyOne();
}
}
isolate_->Dispose();
}
void NextAndWait(TestData* test_data, MemoryAccess access) {
DCHECK(!has_request_);
......@@ -333,6 +336,7 @@ class MemoryAccessThread : public v8::base::Thread {
v8::base::Mutex mutex_;
v8::base::ConditionVariable has_request_cv_;
v8::base::ConditionVariable did_request_cv_;
v8::Isolate* isolate_;
};
TEST(simulator_invalidate_exclusive_access_threaded) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment