1
0
Fork 0

fix: 빠른 변환 후 프로세스 자동 종료 + 진단 로그

- ShutdownMode를 OnExplicitShutdown → OnLastWindowClose 로 변경
  변환 끝나도 WPF가 안 닫혀 좀비 프로세스로 남던 문제. 사용자 입장에선
  "결과가 안 보임"으로 인지됐음. 이제 GUI 닫히면 자동 종료(1초 내)
- RunQuickAsync에 %TEMP%\EverythingToJpeg_quick.log 진단 로그 추가
  (소스 경로, 결과 상태, 출력 경로, 예외 스택을 모두 기록)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yun Chan 2026-05-06 14:50:32 +09:00
parent 5750aed16f
commit 69a6a1360d
2 changed files with 23 additions and 4 deletions

View file

@ -79,6 +79,11 @@ public partial class App : Application
private async Task RunQuickAsync(IReadOnlyList<string> files)
{
var logPath = Path.Combine(Path.GetTempPath(), "EverythingToJpeg_quick.log");
var log = new System.Text.StringBuilder();
log.AppendLine($"[{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff}] Quick start, {files.Count} file(s)");
foreach (var f in files) log.AppendLine($" src: {f}");
var progress = new QuickProgressWindow(files.Count);
progress.Show();
@ -87,14 +92,28 @@ public partial class App : Application
var options = ConvertOptions.Quick();
var reporter = new Progress<ConvertProgress>(p => progress.Report(p));
var results = await Engine.ConvertManyAsync(files, options, reporter);
foreach (var r in results)
{
log.AppendLine($" [{r.Status}] {Path.GetFileName(r.SourcePath)} → {r.OutputPaths.Count} output(s)");
if (r.Message is { Length: > 0 }) log.AppendLine($" msg: {r.Message}");
if (r.Error is not null) log.AppendLine($" err: {r.Error}");
foreach (var o in r.OutputPaths) log.AppendLine($" out: {o}");
}
progress.Finish(results);
}
catch (Exception ex)
{
MessageBox.Show($"변환 중 오류: {ex.Message}", "EverythingToJpeg",
log.AppendLine($" EXCEPTION {ex.GetType().Name}: {ex.Message}");
log.AppendLine(ex.ToString());
try { progress.Close(); } catch { }
MessageBox.Show($"변환 중 오류: {ex.Message}\n\n로그: {logPath}", "EverythingToJpeg",
MessageBoxButton.OK, MessageBoxImage.Error);
progress.Close();
Shutdown(1);
}
finally
{
try { File.WriteAllText(logPath, log.ToString()); } catch { }
}
}
}