lib/sugarcube-factories/uibarbuttonitem.rb in sugarcube-1.4.4 vs lib/sugarcube-factories/uibarbuttonitem.rb in sugarcube-1.4.5
- old
+ new
@@ -127,10 +127,10 @@
# Adds the action and keeps a strong reference to the Proc object.
def set_target_and_action target, action
self.target = target
self.action = 'sugarcube_handle_action:'
- @sugarcube_action = action
+ @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action
end
private