Skip to content

Commit

Permalink
fix: do not check lock_task on iOS before syncing
Browse files Browse the repository at this point in the history
`lock_task` is anyways always `None` on iOS
to avoid lock files held open and cause 0xdead10cc crashes.
  • Loading branch information
r10s committed Dec 6, 2023
1 parent 36c751b commit c784c49
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c784c49

Please sign in to comment.