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

Side by Side Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1426843002: Fix for leaking AnalysisCache and AnalysisContext instances. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/context/cache.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.context.context; 5 library analyzer.src.context.context;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/instrumentation/instrumentation.dart'; 10 import 'package:analyzer/instrumentation/instrumentation.dart';
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 @override 689 @override
690 void dispose() { 690 void dispose() {
691 _disposed = true; 691 _disposed = true;
692 for (List<PendingFuture> pendingFutures in _pendingFutureTargets.values) { 692 for (List<PendingFuture> pendingFutures in _pendingFutureTargets.values) {
693 for (PendingFuture pendingFuture in pendingFutures) { 693 for (PendingFuture pendingFuture in pendingFutures) {
694 pendingFuture.forciblyComplete(); 694 pendingFuture.forciblyComplete();
695 } 695 }
696 } 696 }
697 _pendingFutureTargets.clear(); 697 _pendingFutureTargets.clear();
698 _privatePartition.dispose(); 698 _privatePartition.dispose();
699 _cache.dispose();
699 } 700 }
700 701
701 @override 702 @override
702 List<CompilationUnit> ensureResolvedDartUnits(Source unitSource) { 703 List<CompilationUnit> ensureResolvedDartUnits(Source unitSource) {
703 // Check every library. 704 // Check every library.
704 List<CompilationUnit> units = <CompilationUnit>[]; 705 List<CompilationUnit> units = <CompilationUnit>[];
705 List<Source> containingLibraries = getLibrariesContaining(unitSource); 706 List<Source> containingLibraries = getLibrariesContaining(unitSource);
706 for (Source librarySource in containingLibraries) { 707 for (Source librarySource in containingLibraries) {
707 LibrarySpecificUnit target = 708 LibrarySpecificUnit target =
708 new LibrarySpecificUnit(librarySource, unitSource); 709 new LibrarySpecificUnit(librarySource, unitSource);
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after
2128 DartSdk sdk = factory.dartSdk; 2129 DartSdk sdk = factory.dartSdk;
2129 if (sdk == null) { 2130 if (sdk == null) {
2130 throw new IllegalArgumentException( 2131 throw new IllegalArgumentException(
2131 "The source factory for an SDK analysis context must have a DartUriRes olver"); 2132 "The source factory for an SDK analysis context must have a DartUriRes olver");
2132 } 2133 }
2133 return new AnalysisCache(<CachePartition>[ 2134 return new AnalysisCache(<CachePartition>[
2134 AnalysisEngine.instance.partitionManager_new.forSdk(sdk) 2135 AnalysisEngine.instance.partitionManager_new.forSdk(sdk)
2135 ]); 2136 ]);
2136 } 2137 }
2137 } 2138 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/context/cache.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698