Skip to content

Commit

Permalink
fix bug in selector drop
Browse files Browse the repository at this point in the history
  • Loading branch information
carllerche committed Mar 1, 2024
1 parent a0008b3 commit d7dbbba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sys/windows/named_pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,10 @@ fn event_done(status: &OVERLAPPED_ENTRY, events: Option<&mut Vec<Event>>) {
let io = me.io.lock().unwrap();

// Make sure the I/O handle is still registered with the selector
if io.token.is_some() {
//
// This method is also called during `Selector::drop` to perform cleanup. In
// this case, `events` is `None` and we don't need to track the event.
if io.token.is_some() && events.is_some() {
let mut ev = Event::from_completion_status(&status);
// Reverse the `.data` alteration done in `schedule_event`. This
// alteration was done so the selector recognized the event as one from
Expand Down

0 comments on commit d7dbbba

Please sign in to comment.