Forráskód Böngészése

Fix application shell tests.

Afshin Darian 8 éve
szülő
commit
52481f8aba
1 módosított fájl, 4 hozzáadás és 1 törlés
  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();
   }