Explorar el Código

Clean up session disposal

Steven Silvester hace 8 años
padre
commit
ec068ffcc0
Se han modificado 1 ficheros con 3 adiciones y 13 borrados
  1. 3 13
      packages/services/src/session/default.ts

+ 3 - 13
packages/services/src/session/default.ts

@@ -157,7 +157,7 @@ class DefaultSession implements Session.ISession {
    * Test whether the session has been disposed.
    */
   get isDisposed(): boolean {
-    return this._options === null;
+    return this._isDisposed === true;
   }
 
   /**
@@ -204,7 +204,7 @@ class DefaultSession implements Session.ISession {
     if (this.isDisposed) {
       return;
     }
-    this._options = null;
+    this._isDisposed = true;
     if (this._kernel) {
       this._kernel.dispose();
     }
@@ -309,16 +309,6 @@ class DefaultSession implements Session.ISession {
     this._unhandledMessage.emit(msg);
   }
 
-  /**
-   * Get the options used to create a new kernel.
-   */
-  private _getKernelOptions(): Kernel.IOptions {
-    return {
-      username: this.kernel.username,
-      serverSettings: this.serverSettings
-    };
-  }
-
   /**
    * Send a PATCH to the server, updating the session path or the kernel.
    */
@@ -353,7 +343,7 @@ class DefaultSession implements Session.ISession {
   private _path = '';
   private _kernel: Kernel.IKernel = null;
   private _uuid = '';
-  private _options: Session.IOptions = null;
+  private _isDisposed = false;
   private _updating = false;
   private _kernelChanged = new Signal<this, Kernel.IKernelConnection>(this);
   private _statusChanged = new Signal<this, Kernel.Status>(this);