diff options
-rw-r--r-- | state.rb | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |