From c784c499c23cc53956e9a11b338e37c3587a3e66 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Tue, 5 Dec 2023 22:57:37 +0100 Subject: [PATCH] fix: do not check `lock_task` on iOS before syncing `lock_task` is anyways always `None` on iOS to avoid lock files held open and cause 0xdead10cc crashes. --- src/accounts.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/accounts.rs b/src/accounts.rs index 0b0cba0d7..8e0dd0a2a 100644 --- a/src/accounts.rs +++ b/src/accounts.rs @@ -424,11 +424,13 @@ impl Config { /// Takes a mutable reference because the saved file is a part of the `Config` state. This /// protects from parallel calls resulting to a wrong file contents. async fn sync(&mut self) -> Result<()> { + #[cfg(not(target_os = "ios"))] ensure!(!self .lock_task .as_ref() .context("Config is read-only")? .is_finished()); + let tmp_path = self.file.with_extension("toml.tmp"); let mut file = fs::File::create(&tmp_path) .await