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

Unified Diff: pkg/analyzer/lib/src/generated/constant.dart

Issue 1410573005: Memory leak fix. Use correct analysis context for annotation constants. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/constant.dart
diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart
index 5a3f445a88663d845a7ece8f9f7e73be88c1c5ba..aca4af5bfef2141dec78546b3ae60825e23d87ed 100644
--- a/pkg/analyzer/lib/src/generated/constant.dart
+++ b/pkg/analyzer/lib/src/generated/constant.dart
@@ -1234,8 +1234,9 @@ class ConstantFinder extends RecursiveAstVisitor<Object> {
@override
Object visitAnnotation(Annotation node) {
super.visitAnnotation(node);
+ AnalysisContext owningContext = _getOwningContext();
constantsToCompute.add(new ConstantEvaluationTarget_Annotation(
- context, source, librarySource, node));
+ owningContext, source, librarySource, node));
return null;
}
@@ -1285,6 +1286,14 @@ class ConstantFinder extends RecursiveAstVisitor<Object> {
}
return null;
}
+
+ AnalysisContext _getOwningContext() {
+ if (context is InternalAnalysisContext) {
+ InternalAnalysisContext internalContext = context;
+ return internalContext.getContextFor(librarySource);
+ }
+ return context;
+ }
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698