Skip to content

Commit

Permalink
Leak log guard so it's not dropped early
Browse files Browse the repository at this point in the history
  • Loading branch information
trumank committed Jun 7, 2024
1 parent 462ae2d commit 113f7d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hook/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ unsafe fn patch() -> Result<()> {
if guard.is_none() {
warn!("failed to set up logging");
}
// Normally this guard should be held in the main scope so it's dropped on exit, but since we
// don't control the entrypoint we just leak it so it doesn't get dropped early. In the future
// the UE exit could be hooked to drop the guard there instead.
std::mem::forget(guard);

let pak_path = bin_dir
.and_then(Path::parent)
Expand Down

0 comments on commit 113f7d5

Please sign in to comment.