()
| 76 | }) |
| 77 | }, |
| 78 | async disposeAll() { |
| 79 | Log.Default.info("disposing all instances") |
| 80 | for (const [_key, value] of cache) { |
| 81 | const awaited = await value.catch(() => {}) |
| 82 | if (awaited) { |
| 83 | await context.provide(await value, async () => { |
| 84 | await Instance.dispose() |
| 85 | }) |
| 86 | } |
| 87 | } |
| 88 | cache.clear() |
| 89 | }, |
| 90 | } |