Process requires disposal
This commit is contained in:
@@ -906,7 +906,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence
|
||||
return -1;
|
||||
}
|
||||
|
||||
var p = new Process
|
||||
using (var p = new Process
|
||||
{
|
||||
StartInfo =
|
||||
{
|
||||
@@ -918,13 +918,15 @@ namespace Umbraco.Cms.Infrastructure.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>
|
||||
|
||||
@@ -72,15 +72,17 @@ namespace Umbraco.Cms.Infrastructure.Sync
|
||||
GlobalSettings = globalSettings.Value;
|
||||
_lastPruned = _lastSync = DateTime.UtcNow;
|
||||
_syncIdle = new ManualResetEvent(true);
|
||||
|
||||
// See notes on _localIdentity
|
||||
LocalIdentity = Environment.MachineName // eg DOMAIN\SERVER
|
||||
+ "/" + hostingEnvironment.ApplicationId // eg /LM/S3SVC/11/ROOT
|
||||
+ " [P" + Process.GetCurrentProcess().Id // eg 1234
|
||||
+ "/D" + AppDomain.CurrentDomain.Id // eg 22
|
||||
+ "] " + Guid.NewGuid().ToString("N").ToUpper(); // make it truly unique
|
||||
|
||||
using (var process = Process.GetCurrentProcess())
|
||||
{
|
||||
// See notes on _localIdentity
|
||||
LocalIdentity = Environment.MachineName // eg DOMAIN\SERVER
|
||||
+ "/" + hostingEnvironment.ApplicationId // eg /LM/S3SVC/11/ROOT
|
||||
+ " [P" + process.Id // eg 1234
|
||||
+ "/D" + AppDomain.CurrentDomain.Id // eg 22
|
||||
+ "] " + Guid.NewGuid().ToString("N").ToUpper(); // make it truly unique
|
||||
}
|
||||
_initialized = new Lazy<SyncBootState?>(InitializeWithMainDom);
|
||||
|
||||
}
|
||||
|
||||
public GlobalSettings GlobalSettings { get; }
|
||||
|
||||
Reference in New Issue
Block a user