(win: BaseWindow)
| 107 | } |
| 108 | |
| 109 | removeWindow(win: BaseWindow) { |
| 110 | this.windows.splice(this.windows.indexOf(win), 1); |
| 111 | if (this.windows.length == 0) |
| 112 | this.#onAllWindowsClosed(); |
| 113 | // A closed window usually has a large chunk of memory to recycle. |
| 114 | collectGarbage(); |
| 115 | // The |removeWindow| might be called before window saves states, delay a |
| 116 | // tick to ensure we have the state. |
| 117 | setImmediate(() => this.saveConfig()); |
| 118 | } |
| 119 | |
| 120 | #onAllWindowsClosed() { |
| 121 | if (!this.quitOnAllWindowsClosed) |
no test coverage detected