Index: remoting/webapp/host_native_messaging.js |
diff --git a/remoting/webapp/host_native_messaging.js b/remoting/webapp/host_native_messaging.js |
index 0d48b004091a97e14a077d26f1a4b41296147f86..3fc847343081cc7f7795aebd9062b4ebe637b684 100644 |
--- a/remoting/webapp/host_native_messaging.js |
+++ b/remoting/webapp/host_native_messaging.js |
@@ -365,11 +365,13 @@ remoting.HostNativeMessaging.prototype.onDisconnect_ = function() { |
console.error('Native Message port disconnected'); |
// Notify the error-handlers of any requests that are still outstanding. |
- for (var id in this.pendingReplies_) { |
- this.pendingReplies_[/** @type {number} */(id)].onError( |
+ var pendingReplies = this.pendingReplies_; |
+ this.pendingReplies_ = {}; |
+ |
+ for (var id in pendingReplies) { |
+ pendingReplies[/** @type {number} */(id)].onError( |
remoting.Error.UNEXPECTED); |
} |
- this.pendingReplies_ = {}; |
} |
/** |