replace 'try-finally' with 'using' where appropriate

This commit is contained in:
Mark Monteiro
2020-04-05 09:23:44 -04:00
parent 4efdc63337
commit 658e963e93
2 changed files with 3 additions and 13 deletions
@@ -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);
}
}