Merge branch 'fix-double-close'

This commit is contained in:
James Coglan
2021-03-12 17:01:26 +00:00
+7 -5
View File
@@ -105,12 +105,14 @@ var instance = {
"The code must be either 1000, or between 3000 and 4999. " +
code + " is neither.");
if (this.readyState !== API.CLOSED) this.readyState = API.CLOSING;
var self = this;
if (this.readyState < API.CLOSING) {
var self = this;
this._closeTimer = setTimeout(function() {
self._beginClose('', 1006);
}, API.CLOSE_TIMEOUT);
}
this._closeTimer = setTimeout(function() {
self._beginClose('', 1006);
}, API.CLOSE_TIMEOUT);
if (this.readyState !== API.CLOSED) this.readyState = API.CLOSING;
this._driver.close(reason, code);
},