mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
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.
This commit is contained in:
@@ -424,11 +424,13 @@ impl Config {
|
|||||||
/// Takes a mutable reference because the saved file is a part of the `Config` state. This
|
/// 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.
|
/// protects from parallel calls resulting to a wrong file contents.
|
||||||
async fn sync(&mut self) -> Result<()> {
|
async fn sync(&mut self) -> Result<()> {
|
||||||
|
#[cfg(not(target_os = "ios"))]
|
||||||
ensure!(!self
|
ensure!(!self
|
||||||
.lock_task
|
.lock_task
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.context("Config is read-only")?
|
.context("Config is read-only")?
|
||||||
.is_finished());
|
.is_finished());
|
||||||
|
|
||||||
let tmp_path = self.file.with_extension("toml.tmp");
|
let tmp_path = self.file.with_extension("toml.tmp");
|
||||||
let mut file = fs::File::create(&tmp_path)
|
let mut file = fs::File::create(&tmp_path)
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user