diff --git a/src/memory_tracker-inl.h b/src/memory_tracker-inl.h index 97be794bb86ba5..36ef0f5b38403c 100644 --- a/src/memory_tracker-inl.h +++ b/src/memory_tracker-inl.h @@ -121,7 +121,7 @@ template void MemoryTracker::TrackField(const char* edge_name, const BaseObjectPtrImpl& value, const char* node_name) { - if (value.get() == nullptr) return; + if (value.get() == nullptr || kIsWeak) return; TrackField(edge_name, value.get(), node_name); } @@ -204,6 +204,7 @@ template void MemoryTracker::TrackField(const char* edge_name, const v8::PersistentBase& value, const char* node_name) { + if (value.IsWeak()) return; TrackField(edge_name, value.Get(isolate_)); }