浏览代码

Clean up disposal

Steven Silvester 8 年之前
父节点
当前提交
ceee7c3097
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/notebook/notebook/model.ts

+ 1 - 1
src/notebook/notebook/model.ts

@@ -437,7 +437,7 @@ class NotebookModel extends DocumentModel implements INotebookModel {
       // Add the cell in a new context to avoid triggering another
       // Add the cell in a new context to avoid triggering another
       // cell changed event during the handling of this signal.
       // cell changed event during the handling of this signal.
       requestAnimationFrame(() => {
       requestAnimationFrame(() => {
-        if (!this._cells.length) {
+        if (!this.isDisposed && !this._cells.length) {
           this._cells.pushBack(this._factory.createCodeCell());
           this._cells.pushBack(this._factory.createCodeCell());
         }
         }
       });
       });