Skip to content

Commit

Permalink
fix: don't call ngx_event_del_timer if nginx is exiting
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslanti committed Sep 13, 2024
1 parent b43f646 commit 882e93a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nginx_module/src/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ impl<HandlerFn> Drop for Timer<HandlerFn> {
}

unsafe {
if self.event.timer_set() != 0 {
if self.event.timer_set() != 0
&& ngx_quit == 0
&& ngx_exiting == 0
&& ngx_terminate == 0 {
ngx_event_del_timer(&mut *self.event.as_mut());
}
}
Expand Down

0 comments on commit 882e93a

Please sign in to comment.