Commit cd6f1c98 authored by adamk's avatar adamk Committed by Commit bot

[d8] Fix LeakSanitizer failures on the bots due to ModuleEmbedderData

BUG=v8:1569
TBR=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2403303002
Cr-Commit-Position: refs/heads/master@{#40143}
parent 1f80f66d
...@@ -725,8 +725,12 @@ PerIsolateData::RealmScope::RealmScope(PerIsolateData* data) : data_(data) { ...@@ -725,8 +725,12 @@ PerIsolateData::RealmScope::RealmScope(PerIsolateData* data) : data_(data) {
PerIsolateData::RealmScope::~RealmScope() { PerIsolateData::RealmScope::~RealmScope() {
// Drop realms to avoid keeping them alive. // Drop realms to avoid keeping them alive.
for (int i = 0; i < data_->realm_count_; ++i) for (int i = 0; i < data_->realm_count_; ++i) {
data_->realms_[i].Reset(); Global<Context>& realm = data_->realms_[i];
if (realm.IsEmpty()) continue;
DisposeModuleEmbedderData(realm.Get(data_->isolate_));
realm.Reset();
}
delete[] data_->realms_; delete[] data_->realms_;
if (!data_->realm_shared_.IsEmpty()) if (!data_->realm_shared_.IsEmpty())
data_->realm_shared_.Reset(); data_->realm_shared_.Reset();
......
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