Commit 50263cf
Fix race condition in DisposeProcess that could skip flushing stderr events
When GetUnexpectedExitExceptionAsync sees HasExited as false and returns
null, DisposeProcess is called next. By that time the process may have
exited, causing it to skip KillTree and call Dispose() without first
calling WaitForExit() to flush ErrorDataReceived callbacks. Add a
WaitForExit() call for already-exited processes to ensure all redirected
output events are dispatched before disposal.
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>1 parent 796d7d4 commit 50263cf
1 file changed
Lines changed: 7 additions & 0 deletions
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
230 | 237 | | |
231 | 238 | | |
232 | 239 | | |
| |||
0 commit comments