Skip to content

Commit

Permalink
hltas_bridge: Drop lock during IO
Browse files Browse the repository at this point in the history
How did I miss this...
  • Loading branch information
YaLTeR committed Jan 13, 2024
1 parent 4ee4dfb commit 2c301dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/tas_studio/hltas_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ fn write_thread(
}
Some(Request::Stop) => break,
Some(Request::Write(script)) => {
drop(request);

let file = match File::create(&tmp_path) {
Ok(file) => file,
Err(err) => {
Expand All @@ -105,6 +107,8 @@ fn write_thread(
if let Err(err) = fs::rename(&tmp_path, &path) {
warn!("Error renaming temp .hltas to bridged file: {err:?}");
}

request = lock.lock().unwrap();
}
}
}
Expand Down

0 comments on commit 2c301dc

Please sign in to comment.