From 56ebe9f9f4eb71673c659d1875a6964bd26ecd9a Mon Sep 17 00:00:00 2001 From: Thibaud Guillaume-Gentil Date: Thu, 29 Sep 2011 22:39:24 +0200 Subject: [PATCH] Improve guard stop - prevent run_guard_task(:stop) to be skipped --- lib/guard.rb | 7 ++++++- lib/guard/listeners/linux.rb | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/guard.rb b/lib/guard.rb index 6292faa..b41b0ec 100644 --- a/lib/guard.rb +++ b/lib/guard.rb @@ -122,8 +122,13 @@ module Guard # def stop UI.info 'Bye bye...', :reset => true - listener.stop + + listener.lock + interactor.lock + run_guard_task(:stop) + + listener.stop abort end diff --git a/lib/guard/listeners/linux.rb b/lib/guard/listeners/linux.rb index b14bcb6..3e129c8 100644 --- a/lib/guard/listeners/linux.rb +++ b/lib/guard/listeners/linux.rb @@ -26,7 +26,6 @@ module Guard def stop super @stop = true - sleep(@latency) end # Check if the listener is usable on the current OS.