DIspose Process (#10918)

This commit is contained in:
Chad
2021-08-24 00:44:48 +12:00
committed by GitHub
parent f26fbafa71
commit a2dab5b6ca
3 changed files with 34 additions and 21 deletions

View File

@@ -901,7 +901,7 @@ namespace Umbraco.Core.Persistence
return -1;
}
var p = new Process
using (var p = new Process
{
StartInfo =
{
@@ -913,13 +913,16 @@ namespace Umbraco.Core.Persistence
CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden
}
};
p.Start();
output = p.StandardOutput.ReadToEnd();
error = p.StandardError.ReadToEnd();
p.WaitForExit();
})
{
p.Start();
output = p.StandardOutput.ReadToEnd();
error = p.StandardError.ReadToEnd();
p.WaitForExit();
return p.ExitCode;
return p.ExitCode;
}
}
/// <summary>