diff options
Diffstat (limited to 'state.rb')
-rw-r--r-- | state.rb | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -123,11 +123,7 @@ class State # Set this state to untrue def drop - return unless @active - trace "Dropping #{self}" - break_holds if @holds.size > 0 - becomes_defunct - self.class.falling_edge.call(params) + becomes_defunct(true) end # Parameters to this state @@ -137,10 +133,14 @@ class State end # Set this state to untrue without running any falling edge code - def becomes_defunct + def becomes_defunct(drop=false) return unless @active - break_holds if @holds.size > 0 @active = false + break_holds if @holds.size > 0 + if drop + trace "Dropping #{self}" + self.class.falling_edge.call(params) + end @deps.each{ |x| x.release(self) } State.gc State.depsolve_all |