Skip to content

Commit

Permalink
Revert "Bugfix: Dispose process handle."
Browse files Browse the repository at this point in the history
This reverts commit a153a89.
  • Loading branch information
peters committed May 22, 2022
1 parent 310ed2c commit 50b9249
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Snap/AnyOS/SnapOsProcessManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public SnapOsProcess Build(int pid, string name, string workingDirectory = defau

static async Task<(int exitCode, string standardOutput)> RunAsync(ProcessStartInfo processStartInfo, CancellationToken cancellationToken)
{
using var process = Process.Start(processStartInfo);
var process = Process.Start(processStartInfo);
if (process == null)
{
throw new Exception($"Error invoking process: {processStartInfo.FileName}. Arguments: {processStartInfo.Arguments}");
Expand Down
2 changes: 1 addition & 1 deletion src/Snap/Core/SnapInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ async Task InvokeSnapApps([NotNull] List<ProcessStartInfoBuilder> allSnapAwareAp
.Add($"--snapx-first-run {semanticVersion.ToNormalizedString()}");
try
{
using var _ = _snapOs.ProcessManager
_snapOs.ProcessManager
.StartNonBlocking(builder);
}
catch (Exception ex)
Expand Down
1 change: 0 additions & 1 deletion src/Snap/Core/Snapx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ public static bool StartSupervisor(List<string> restartArguments = null)

var coreRunArgument = $"--corerun-supervise-pid={SnapOs.ProcessManager.Current.Id} --corerun-supervise-id={superVisorId}";

SuperVisorProcess?.Dispose();
SuperVisorProcess = SnapOs.ProcessManager.StartNonBlocking(new ProcessStartInfoBuilder(SuperVisorProcessExeDirectory)
.AddRange(restartArguments ?? new List<string>())
.Add(coreRunArgument)
Expand Down

0 comments on commit 50b9249

Please sign in to comment.