Skip to content

Commit

Permalink
Fix unwrap that are triggered on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
stormshield-gwendald committed Dec 5, 2024
1 parent f2fdd19 commit 6d9dded
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ unsafe extern "system" fn callback(
n if n == MibDeleteInstance => RouteEvent::Delete(route),
_ => return,
};
sender.send(event).unwrap();
if let Err(_) = sender.send(event) {
// If their no receiver, this may indicate that the system is currently shutting down
}
}

fn code_to_error(code: u32, msg: &str) -> io::Error {
Expand Down

0 comments on commit 6d9dded

Please sign in to comment.