@@ -73,7 +73,7 @@ public Cargo()
7373
7474 protected override IReadOnlyList < Package > FindPackages_UnSafe ( string query )
7575 {
76- Process p = GetProcess ( Status . ExecutablePath , "search -q --color=never " + query ) ;
76+ using Process p = GetProcess ( Status . ExecutablePath , "search -q --color=never " + query ) ;
7777 IProcessTaskLogger logger = TaskLogger . CreateNew ( LoggableTaskType . FindPackages , p ) ;
7878 p . Start ( ) ;
7979
@@ -142,7 +142,7 @@ protected override ManagerStatus LoadManager()
142142 return new ( ) { ExecutablePath = executablePath , Found = false , Version = "" } ;
143143 }
144144
145- Process p = GetProcess ( executablePath , "--version" ) ;
145+ using Process p = GetProcess ( executablePath , "--version" ) ;
146146 p . Start ( ) ;
147147 string version = p . StandardOutput . ReadToEnd ( ) . Trim ( ) ;
148148 string error = p . StandardError . ReadToEnd ( ) ;
@@ -174,7 +174,7 @@ private IReadOnlyList<Package> GetPackages(LoggableTaskType taskType)
174174 private List < Match > GetInstalledCommandOutput ( )
175175 {
176176 List < Match > output = [ ] ;
177- Process p = GetProcess ( Status . ExecutablePath , "install-update --list" ) ;
177+ using Process p = GetProcess ( Status . ExecutablePath , "install-update --list" ) ;
178178 IProcessTaskLogger logger = TaskLogger . CreateNew ( LoggableTaskType . OtherTask , p ) ;
179179 logger . AddToStdOut ( "Other task: Call the install-update command" ) ;
180180 p . Start ( ) ;
0 commit comments