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

Unified Diff: pkg/analyzer/lib/src/dart/analysis/driver.dart

Issue 2532353002: Dispose AnalysisContext(s) used to resynthesize CompilationUnitElement(s) for IndexResult(s). (Closed)
Patch Set: Created 4 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: pkg/analyzer/lib/src/dart/analysis/driver.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index 7d493d612f89a16d6e64bca07cd4048013e30528..ecf4de5e3f2a850e13266307fcf3c0b70868ace3 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -592,9 +592,14 @@ class AnalysisDriver {
AnalysisContext analysisContext = _createAnalysisContext(libraryContext);
// Resynthesize the CompilationUnitElement in the context.
- CompilationUnitElement unitElement = analysisContext.computeResult(
- new LibrarySpecificUnit(libraryFile.source, file.source),
- COMPILATION_UNIT_ELEMENT);
+ CompilationUnitElement unitElement;
+ try {
+ unitElement = analysisContext.computeResult(
+ new LibrarySpecificUnit(libraryFile.source, file.source),
+ COMPILATION_UNIT_ELEMENT);
+ } finally {
+ analysisContext.dispose();
+ }
// Return as IndexResult.
return new IndexResult(unitElement, analysisResult._index);
« 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