replace 'try-finally' with 'using' where appropriate
This commit is contained in:
parent
4efdc63337
commit
658e963e93
|
@ -1709,14 +1709,9 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
|
||||
private void Process_Exited(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
using (var process = (Process)sender)
|
||||
{
|
||||
var exitCode = ((Process)sender).ExitCode;
|
||||
_logger.LogInformation("Recording post-processing script completed with exit code {ExitCode}", exitCode);
|
||||
}
|
||||
finally
|
||||
{
|
||||
((Process)sender).Dispose();
|
||||
_logger.LogInformation("Recording post-processing script completed with exit code {ExitCode}", process.ExitCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -289,8 +289,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
/// </summary>
|
||||
private void OnFfMpegProcessExited(Process process, string inputFile)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (process) {
|
||||
_hasExited = true;
|
||||
|
||||
_logFileStream?.Dispose();
|
||||
|
@ -315,10 +314,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
exitCode)));
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
process.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private async void StartStreamingLog(Stream source, Stream target)
|
||||
|
|
Loading…
Reference in New Issue
Block a user