mirror of https://github.com/jellyfin/jellyfin.git
Dispose of process correctly in AttachmentExtractor
This commit is contained in:
parent
1c13be085f
commit
d705931e81
|
@ -164,12 +164,11 @@ namespace MediaBrowser.MediaEncoding.Attachments
|
|||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
ErrorDialog = false
|
||||
};
|
||||
var process = new Process
|
||||
{
|
||||
StartInfo = startInfo,
|
||||
EnableRaisingEvents = true
|
||||
};
|
||||
|
||||
int exitCode;
|
||||
|
||||
using (var process = new Process { StartInfo = startInfo, EnableRaisingEvents = true })
|
||||
{
|
||||
_logger.LogInformation("{File} {Arguments}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
|
||||
process.Start();
|
||||
|
@ -189,9 +188,8 @@ namespace MediaBrowser.MediaEncoding.Attachments
|
|||
}
|
||||
}
|
||||
|
||||
var exitCode = ranToCompletion ? process.ExitCode : -1;
|
||||
|
||||
process.Dispose();
|
||||
exitCode = ranToCompletion ? process.ExitCode : -1;
|
||||
}
|
||||
|
||||
var failed = false;
|
||||
|
||||
|
|
Loading…
Reference in New Issue