Fix File.Delete Failure by Waiting for FFmpegProcess to Exit

This commit is contained in:
copecone committed 2026-06-01 18:00:30 +09:00
1 parent 54a4d2e7bb
commit d7ca416980
2 files changed
+6 -2

No files matched your search

+1 -1
View File
@@ -601,7 +601,7 @@ namespace ADOFAIRenderer.Core
if (_activeVideoFFmpeg != null) if (_activeVideoFFmpeg != null)
{ {
_activeVideoFFmpeg.Kill(); _activeVideoFFmpeg.Kill(16384);
_activeVideoFFmpeg = null; _activeVideoFFmpeg = null;
} }
+5 -1
View File
@@ -74,13 +74,17 @@ namespace ADOFAIRenderer.Util.FFmpeg
} }
} }
public void Kill() public void Kill(int timeoutMs = 0)
{ {
try try
{ {
if (_ffmpegProcess != null && !_ffmpegProcess.HasExited) if (_ffmpegProcess != null && !_ffmpegProcess.HasExited)
{ {
_ffmpegProcess.Kill(); _ffmpegProcess.Kill();
if (timeoutMs > 0)
{
_ffmpegProcess.WaitForExit(timeoutMs);
}
} }
} }
catch (Exception) catch (Exception)