Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index bd6b7b4fbee90b65c6464701e9630637b4acb349..32e6636ecb0d9d423e39a15a935e4b4bfb09f258 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -725,12 +725,8 @@ |
PerIsolateData::RealmScope::~RealmScope() { |
// Drop realms to avoid keeping them alive. |
- 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(); |
- } |
+ for (int i = 0; i < data_->realm_count_; ++i) |
+ data_->realms_[i].Reset(); |
delete[] data_->realms_; |
if (!data_->realm_shared_.IsEmpty()) |
data_->realm_shared_.Reset(); |