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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java

Issue 8477025: Ensure ClassElementImplementation removed from ThreadLocal set to prevent memory leak (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 1 month 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: compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java
===================================================================
--- compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java (revision 1240)
+++ compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java (working copy)
@@ -319,35 +319,38 @@
throw new CyclicDeclarationException(this);
}
ArrayList<InterfaceType> supertypes = new ArrayList<InterfaceType>();
- for (InterfaceType intf : getInterfaces()) {
- addCheckDuplicated(interfaces, supertypes, intf);
- }
- for (InterfaceType intf : getInterfaces()) {
- for (InterfaceType t : intf.getElement().getAllSupertypes()) {
- if (!t.getElement().isObject()) {
- addCheckDuplicated(interfaces, supertypes,
- t.subst(intf.getArguments(),
- intf.getElement().getTypeParameters()));
- }
+ try {
+ for (InterfaceType intf : getInterfaces()) {
+ addCheckDuplicated(interfaces, supertypes, intf);
}
- }
- if (supertype != null) {
- for (InterfaceType t : supertype.getElement().getAllSupertypes()) {
- if (t.getElement().isInterface()) {
- addCheckDuplicated(interfaces, supertypes,
- t.subst(supertype.getArguments(),
- supertype.getElement().getTypeParameters()));
+ for (InterfaceType intf : getInterfaces()) {
+ for (InterfaceType t : intf.getElement().getAllSupertypes()) {
+ if (!t.getElement().isObject()) {
+ addCheckDuplicated(interfaces, supertypes,
+ t.subst(intf.getArguments(),
+ intf.getElement().getTypeParameters()));
+ }
}
}
- supertypes.add(supertype);
- for (InterfaceType t : supertype.getElement().getAllSupertypes()) {
- if (!t.getElement().isInterface()) {
- supertypes.add(t.subst(supertype.getArguments(),
- supertype.getElement().getTypeParameters()));
+ if (supertype != null) {
+ for (InterfaceType t : supertype.getElement().getAllSupertypes()) {
+ if (t.getElement().isInterface()) {
+ addCheckDuplicated(interfaces, supertypes,
+ t.subst(supertype.getArguments(),
+ supertype.getElement().getTypeParameters()));
+ }
}
+ supertypes.add(supertype);
+ for (InterfaceType t : supertype.getElement().getAllSupertypes()) {
+ if (!t.getElement().isInterface()) {
+ supertypes.add(t.subst(supertype.getArguments(),
+ supertype.getElement().getTypeParameters()));
+ }
+ }
}
+ } finally {
danrubel 2011/11/07 11:13:07 Added try/finally to ensure "this" was removed fro
+ seenSupertypes.get().remove(this);
}
- seenSupertypes.get().remove(this);
return supertypes;
}
« 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