()
| 152 | * Fire-and-forget is still valid where timing doesn't matter. |
| 153 | */ |
| 154 | export function dispose(): Promise<void> { |
| 155 | disposed = true |
| 156 | if (mdmPollTimer) { |
| 157 | clearInterval(mdmPollTimer) |
| 158 | mdmPollTimer = null |
| 159 | } |
| 160 | for (const timer of pendingDeletions.values()) clearTimeout(timer) |
| 161 | pendingDeletions.clear() |
| 162 | lastMdmSnapshot = null |
| 163 | clearInternalWrites() |
| 164 | settingsChanged.clear() |
| 165 | const w = watcher |
| 166 | watcher = null |
| 167 | return w ? w.close() : Promise.resolve() |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * Subscribe to settings changes |
nothing calls this directly
no test coverage detected