Skip to content

Commit

Permalink
Merge pull request #7 from G-Core/fix/sigsegv_on_timer_drop
Browse files Browse the repository at this point in the history
 don't call ngx_event_del_timer if nginx is exiting
  • Loading branch information
ruslanti authored Sep 16, 2024
2 parents b43f646 + 882e93a commit 63eca13
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 63eca13

Please sign in to comment.