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

Unified Diff: Source/core/svg/properties/SVGAnimatedProperty.cpp

Issue 133273005: [SVG] Defer recursive detachAnimatedProperty call to avoid touching invalidated iterator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix compile err Created 6 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/properties/SVGAnimatedProperty.cpp
diff --git a/Source/core/svg/properties/SVGAnimatedProperty.cpp b/Source/core/svg/properties/SVGAnimatedProperty.cpp
index 2258ad93f57ec028c6defd8dd123d7983db95770..20a796c5182a1a28f0fe0ede9e51476870a1a81a 100644
--- a/Source/core/svg/properties/SVGAnimatedProperty.cpp
+++ b/Source/core/svg/properties/SVGAnimatedProperty.cpp
@@ -56,8 +56,14 @@ void SVGAnimatedProperty::detachAnimatedPropertiesForElement(SVGElement* element
}
}
- for (Vector<SVGAnimatedPropertyDescription>::const_iterator it = keysToRemove.begin(); it != keysToRemove.end(); ++it)
+ // Workaround for http://crbug.com/333156 :
pdr. 2014/01/14 04:33:25 Please remove the workaround comment, as I think w
kouhei (in TOK) 2014/01/14 04:51:27 Done.
+ // There are unknown cases where detachAnimatedPropertiesForElement is called recursively from ~SVGAnimatedProperty.
+ // This vector makes this function safe by deferring the recursive call until we finish touching the HashMap.
+ Vector<RefPtr<SVGAnimatedProperty> > deferredPropertyDestruct;
pdr. 2014/01/14 04:33:25 I would also change this comment slightly to just
kouhei (in TOK) 2014/01/14 04:51:27 Done.
+ for (Vector<SVGAnimatedPropertyDescription>::const_iterator it = keysToRemove.begin(); it != keysToRemove.end(); ++it) {
+ deferredPropertyDestruct.append(cache->get(*it));
pdr. 2014/01/14 04:33:25 I'm okay with a temporary workaround but I think w
kouhei (in TOK) 2014/01/14 04:45:07 No. The problem is that SVGAnimatedProperty is som
kouhei (in TOK) 2014/01/14 04:51:27 Done.
cache->remove(*it);
+ }
}
void SVGAnimatedProperty::commitChange()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698