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

Unified Diff: runtime/bin/builtin.dart

Issue 1278623002: - Make sure to close the port if a packages file was passed on the (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address previous review comments. Created 5 years, 4 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 | runtime/bin/vmservice/loader.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin.dart
diff --git a/runtime/bin/builtin.dart b/runtime/bin/builtin.dart
index d678665b89917dd242a11cb98baf27972c612500..feb26a91a6d65f89a1dbc7b561ca2f5c5992868e 100644
--- a/runtime/bin/builtin.dart
+++ b/runtime/bin/builtin.dart
@@ -309,13 +309,15 @@ Uri _resolveScriptUri(String scriptName) {
void _finishLoadRequest(_LoadRequest req) {
- // Now that we are done with loading remove the request from the map.
- var tmp = _reqMap.remove(req._id);
- assert(tmp == req);
- if (_traceLoading) {
- _log("Loading of ${req._uri} finished: "
- "${_reqMap.length} requests remaining, "
- "${_pendingPackageLoads.length} packages pending.");
+ if (req != null) {
+ // Now that we are done with loading remove the request from the map.
+ var tmp = _reqMap.remove(req._id);
+ assert(tmp == req);
+ if (_traceLoading) {
+ _log("Loading of ${req._uri} finished: "
+ "${_reqMap.length} requests remaining, "
+ "${_pendingPackageLoads.length} packages pending.");
+ }
}
if (!_pendingLoads()) {
@@ -447,6 +449,8 @@ void _handlePackagesReply(msg) {
// Reset the pending package loads to empty. So that we eventually can
// finish loading.
_pendingPackageLoads = [];
+ // Make sure that the receive port is closed if no other loads are pending.
+ _finishLoadRequest(null);
}
« no previous file with comments | « no previous file | runtime/bin/vmservice/loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698