Skip to content

Commit c784c49

Browse files
committed
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.
1 parent 36c751b commit c784c49

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/accounts.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,13 @@ impl Config {
424424
/// Takes a mutable reference because the saved file is a part of the `Config` state. This
425425
/// protects from parallel calls resulting to a wrong file contents.
426426
async fn sync(&mut self) -> Result<()> {
427+
#[cfg(not(target_os = "ios"))]
427428
ensure!(!self
428429
.lock_task
429430
.as_ref()
430431
.context("Config is read-only")?
431432
.is_finished());
433+
432434
let tmp_path = self.file.with_extension("toml.tmp");
433435
let mut file = fs::File::create(&tmp_path)
434436
.await

0 commit comments

Comments
 (0)