summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--state.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/state.rb b/state.rb
index c1f6c9f..b82b81f 100644
--- a/state.rb
+++ b/state.rb
@@ -155,11 +155,12 @@ class State
# Release a hold on this state. Arguments are the same as for +hold+.
def release(hold, params = {})
+ return if @holds.size == 0
hold = Hold::Dep.new(hold) if hold.is_a? State
hold = Hold::User.new(params) if hold == :user
hold = Hold::System.new(params) if hold == :system
raise TypeError unless hold.is_a? Hold
- @holds.delete hold
+ @holds.reject!{ |x| hold == x }
drop if @holds.size == 0
self
end