Rework how we edit processes so tests pass and it fixes the bug

This commit is contained in:
Timothy Baldridge 2021-07-15 15:03:59 -06:00
parent 1adf4b78b0
commit 4f4d8c487b

View File

@ -80,9 +80,10 @@ namespace Wabbajack.Common
};
p.ErrorDataReceived += ErrorEventHandler;
p.Start();
p.BeginErrorReadLine();
p.BeginOutputReadLine();
p.Start();
ChildProcessTracker.AddProcess(p);
@ -95,8 +96,10 @@ namespace Wabbajack.Common
// ignored
}
var result = await finished.Task;
// Do this to make sure everything flushes
p.WaitForExit();
p.CancelErrorRead();
p.CancelOutputRead();
p.OutputDataReceived -= OutputDataReceived;