From ab57553949a082a0dcd3c080eba236790ce287a5 Mon Sep 17 00:00:00 2001 From: vikingowl Date: Tue, 12 Aug 2025 06:00:14 +0200 Subject: [PATCH] Revert "[feat] add panic hook and normal exit cleanup for `.last_model` file handling" This reverts commit cd25b526c6b1b30dd0c05df391dc9383404022a7. --- src/main.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/main.rs b/src/main.rs index cd19753..4ea02d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -254,17 +254,6 @@ fn run() -> Result<()> { path: last_model_path.clone(), }; - // Also ensure cleanup on panic: install a panic hook that removes .last_model, then chains - { - let last_for_panic = last_model_path.clone(); - let prev_hook = std::panic::take_hook(); - std::panic::set_hook(Box::new(move |info| { - let _ = std::fs::remove_file(&last_for_panic); - // chain to default/previous hook for normal panic reporting - prev_hook(info); - })); - } - // Select backend let requested = match args.gpu_backend { GpuBackendCli::Auto => BackendKind::Auto, @@ -751,8 +740,6 @@ fn run() -> Result<()> { } } - // Final best-effort cleanup of .last_model on normal exit - let _ = std::fs::remove_file(&last_model_path); Ok(()) }