##// END OF EJS Templates
Only set channels to null when they are fully closed
Jessica B. Hamrick -
Show More
@@ -355,11 +355,18 define([
355 * @method stop_channels
355 * @method stop_channels
356 */
356 */
357 Kernel.prototype.stop_channels = function () {
357 Kernel.prototype.stop_channels = function () {
358 var that = this;
359 var close = function (c) {
360 return function () {
361 if (that.channels[c].readyState === WebSocket.CLOSED) {
362 that.channels[c] = null;
363 }
364 };
365 };
358 for (var c in this.channels) {
366 for (var c in this.channels) {
359 if ( this.channels[c] !== null ) {
367 if ( this.channels[c] !== null ) {
360 this.channels[c].onclose = null;
368 this.channels[c].onclose = close(c);
361 this.channels[c].close();
369 this.channels[c].close();
362 this.channels[c] = null;
363 }
370 }
364 }
371 }
365 };
372 };
@@ -378,6 +385,15 define([
378 }
385 }
379 return true;
386 return true;
380 };
387 };
388
389 Kernel.prototype.is_fully_disconnected = function () {
390 for (var c in this.channels) {
391 if (this.channels[c] === null) {
392 return true;
393 }
394 }
395 return false;
396 };
381
397
382 // send a message on the Kernel's shell channel
398 // send a message on the Kernel's shell channel
383 Kernel.prototype.send_shell_message = function (msg_type, content, callbacks, metadata) {
399 Kernel.prototype.send_shell_message = function (msg_type, content, callbacks, metadata) {
General Comments 0
You need to be logged in to leave comments. Login now