浏览代码

Fix application shell tests.

Afshin Darian 8 年之前
父节点
当前提交
52481f8aba
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/application/shell.ts

+ 4 - 1
src/application/shell.ts

@@ -327,7 +327,10 @@ class ApplicationShell extends Widget {
    * Close all widgets in the main area.
    */
   closeAll(): void {
-    each(this._dockPanel.widgets(), widget => { widget.close(); });
+    // Make a copy of all the widget in the dock panel (using `toArray()`)
+    // before removing them because removing them while iterating through them
+    // modifies the underlying data of the iterator.
+    each(toArray(this._dockPanel.widgets()), widget => { widget.close(); });
     this._save();
   }