We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fb26ad commit 255ae89Copy full SHA for 255ae89
notebook/static/services/kernels/kernel.js
@@ -576,18 +576,13 @@ define([
576
*
577
* @function stop_channels
578
*/
579
- var that = this;
580
- var close = function () {
581
- if (that.ws && that.ws.readyState === WebSocket.CLOSED) {
582
- that.ws = null;
583
- }
584
- };
585
if (this.ws !== null) {
586
- if (this.ws.readyState === WebSocket.OPEN) {
587
- this.ws.onclose = close;
588
- this.ws.close();
589
- } else {
590
- close();
+ var ws = this.ws;
+ this.ws = null;
+ if (ws.readyState === WebSocket.OPEN) {
+ // unregister onclose callbacks
+ ws.onclose = function () {};
+ ws.close();
591
}
592
593
};
0 commit comments