From c7e6394628f0e36cc3bfea3b55225dbd0bf0053e Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 9 Sep 2024 19:42:01 -0600 Subject: [PATCH] Try to resolve deleting autoupdate tmp dir --- objdiff-gui/src/jobs/update.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/objdiff-gui/src/jobs/update.rs b/objdiff-gui/src/jobs/update.rs index 8ffc59c..178dd7a 100644 --- a/objdiff-gui/src/jobs/update.rs +++ b/objdiff-gui/src/jobs/update.rs @@ -36,7 +36,7 @@ fn run_update( let tmp_file = File::create(&tmp_path)?; self_update::Download::from_url(&asset.download_url) .set_header(reqwest::header::ACCEPT, "application/octet-stream".parse()?) - .download_to(&tmp_file)?; + .download_to(tmp_file)?; update_status(status, "Extracting release".to_string(), 2, 3, &cancel)?; let tmp_file = tmp_dir.path().join("replacement_tmp"); @@ -51,6 +51,7 @@ fn run_update( perms.set_mode(0o755); fs::set_permissions(&target_file, perms)?; } + tmp_dir.close()?; update_status(status, "Complete".to_string(), 3, 3, &cancel)?; Ok(Box::from(UpdateResult { exe_path: target_file }))