[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}
This commit is contained in:
parent
1f80f66de0
commit
cd6f1c98f9
@ -725,8 +725,12 @@ PerIsolateData::RealmScope::RealmScope(PerIsolateData* data) : data_(data) {
|
||||
|
||||
PerIsolateData::RealmScope::~RealmScope() {
|
||||
// Drop realms to avoid keeping them alive.
|
||||
for (int i = 0; i < data_->realm_count_; ++i)
|
||||
data_->realms_[i].Reset();
|
||||
for (int i = 0; i < data_->realm_count_; ++i) {
|
||||
Global<Context>& realm = data_->realms_[i];
|
||||
if (realm.IsEmpty()) continue;
|
||||
DisposeModuleEmbedderData(realm.Get(data_->isolate_));
|
||||
realm.Reset();
|
||||
}
|
||||
delete[] data_->realms_;
|
||||
if (!data_->realm_shared_.IsEmpty())
|
||||
data_->realm_shared_.Reset();
|
||||
|
Loading…
Reference in New Issue
Block a user