Skip to content

Commit c4569ae

Browse files
committed
Move BeginOutputReadLine and BeginErrorReadLine after Start
1 parent 0431d0b commit c4569ae

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

AssetRipper.NativeDialogs/ConfirmationDialog.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@ public Options(string message, Type type = Type.OkCancel)
141141
process.StartInfo.ArgumentList.Add(escapedFalseLabel);
142142
}
143143

144-
process.BeginOutputReadLine();
145-
process.BeginErrorReadLine();
146-
147144
if (!process.Start())
148145
{
149146
return null; // Failed to start the process
150147
}
151148

149+
process.BeginOutputReadLine();
150+
process.BeginErrorReadLine();
151+
152152
await process.WaitForExitAsync();
153153

154154
return process.ExitCode switch
@@ -173,14 +173,14 @@ public Options(string message, Type type = Type.OkCancel)
173173
process.StartInfo.ArgumentList.Add(options.Type is Type.YesNo ? "--yesno" : "--okcancel");
174174
process.StartInfo.ArgumentList.Add(escapedMessage);
175175

176-
process.BeginOutputReadLine();
177-
process.BeginErrorReadLine();
178-
179176
if (!process.Start())
180177
{
181178
return null; // Failed to start the process
182179
}
183180

181+
process.BeginOutputReadLine();
182+
process.BeginErrorReadLine();
183+
184184
await process.WaitForExitAsync();
185185

186186
return process.ExitCode switch

AssetRipper.NativeDialogs/ProcessExecutor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ public static string EscapeString(string str)
4242
}
4343
};
4444

45-
process.BeginOutputReadLine();
46-
process.BeginErrorReadLine();
47-
4845
if (!process.Start())
4946
{
5047
return null;
5148
}
5249

50+
process.BeginOutputReadLine();
51+
process.BeginErrorReadLine();
52+
5353
await process.WaitForExitAsync();
5454

5555
string result = output.ToString().Trim();

0 commit comments

Comments
 (0)