Преглед изворни кода

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();
   }