Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(756)

Unified Diff: Source/core/dom/Attr.cpp

Issue 317203005: Oilpan: Temporary fix for leaks through mapping from element to attribute node list. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Maintain Attr value when Element is deent dies. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Attr.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Attr.cpp
diff --git a/Source/core/dom/Attr.cpp b/Source/core/dom/Attr.cpp
index 496203f6950b630ad01404583f55caa90b3688ee..b4d7c830076eca565f626b2c00ccdea3a86eba82 100644
--- a/Source/core/dom/Attr.cpp
+++ b/Source/core/dom/Attr.cpp
@@ -219,9 +219,15 @@ void Attr::attachToElement(Element* element, const AtomicString& attachedLocalNa
m_standaloneValueOrAttachedLocalName = attachedLocalName;
}
+void Attr::clearWeakMembers(Visitor* visitor)
+{
+ if (m_element && !visitor->isAlive(m_element))
+ detachFromElementWithValue(value());
+}
+
void Attr::trace(Visitor* visitor)
{
- visitor->trace(m_element);
+ visitor->registerWeakMembers<Attr, &Attr::clearWeakMembers>(this);
ContainerNode::trace(visitor);
}
« no previous file with comments | « Source/core/dom/Attr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698