diff --git a/shell/renderer/api/context_bridge/object_cache.cc b/shell/renderer/api/context_bridge/object_cache.cc index 8d111747e5ba..9646d5358a19 100644 --- a/shell/renderer/api/context_bridge/object_cache.cc +++ b/shell/renderer/api/context_bridge/object_cache.cc @@ -21,7 +21,15 @@ ObjectCachePairNode::ObjectCachePairNode(ObjectCachePair&& pair) { ObjectCachePairNode::~ObjectCachePairNode() = default; ObjectCache::ObjectCache() {} -ObjectCache::~ObjectCache() = default; +ObjectCache::~ObjectCache() { + for (const auto& pair : proxy_map_) { + while (!pair.second.empty()) { + ObjectCachePairNode* node = pair.second.head()->value(); + node->RemoveFromList(); + delete node; + } + } +} void ObjectCache::CacheProxiedObject(v8::Local from, v8::Local proxy_value) {