Commit acc17e1
Fix disposable leak warning from in-process node.js file watcher (#320246)
NodeJSFileWatcherLibrary.watch() awaited doWatch() and then called
this._register() on the result. If the watcher was disposed during that
async window, _store was already disposed, producing a "disposable added
to a disposed store" warning and leaking the fs.watch handle.
Use thenRegisterOrDispose so the resolved handle is disposed instead of
registered when the watcher is torn down mid-flight. This is common in
the agent host where non-recursive watching runs in-process and
SessionCustomizationDiscovery churns watchers on file changes.
Fixes #320245
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 9146ae1 commit acc17e1
1 file changed
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
0 commit comments