| 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);
|
| }
|
|
|
|
|
|
|