Skip to content

Commit 4750440

Browse files
chore: remove dead unused Process allocation in GetProcessCommandLine
GetProcessCommandLine allocated `var result = new System.Diagnostics.Process()` that is never used — the method does its work through a separate `using var p = Process.Start(psi)`. Because `result` is never Start()ed it holds no OS handle, so this is dead code (an unused allocation), not a runtime leak. Remove it. Refs #1003.
1 parent e0afbc4 commit 4750440

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

‎src/OpenClaw.SetupEngine/SetupSteps.cs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3615,7 +3615,6 @@ internal static bool IsKeepaliveCommandLine(string? commandLine, string distro)
36153615
try
36163616
{
36173617
// Use WMI to get the command line
3618-
var result = new System.Diagnostics.Process();
36193618
var psi = new System.Diagnostics.ProcessStartInfo("powershell.exe",
36203619
$"-NoProfile -Command \"(Get-CimInstance Win32_Process -Filter 'ProcessId={pid}').CommandLine\"")
36213620
{

0 commit comments

Comments
 (0)