about summary refs log tree commit homepage
path: root/lib/yahns/acceptor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/acceptor.rb')
-rw-r--r--lib/yahns/acceptor.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/yahns/acceptor.rb b/lib/yahns/acceptor.rb
index cd9e055..0cebea2 100644
--- a/lib/yahns/acceptor.rb
+++ b/lib/yahns/acceptor.rb
@@ -19,7 +19,10 @@ module Yahns::Acceptor # :nodoc:
 
   # just keep looping this on every acceptor until the associated thread dies
   def ac_quit
-    return true unless defined?(@thrs)
+    unless defined?(@thrs) # acceptor has not started yet, freshly inherited
+      close
+      return true
+    end
     @thrs.each { |t| t[:yahns_quit] = true }
     return true if __ac_quit_done?