Cocoa wrappers and helpers for RubyMotion (Ruby for iOS and OS X) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull requests
Other
1.18k
stars
208
forks
source link
Eventable .off fix when using method(:my_method) syntax #399
Two method objects are equal if they are bound to the same object and refer to the same method definition and their owners are the same class or module.
If you begin observing an object after creating an event with a method(:), it can change the owner property of method(:) when you go to take off the event.
This change relaxes the definition of == for method objects for removal.
This PR contains a memory fix from PR(https://github.com/rubymotion/BubbleWrap/pull/398). Using ruby's method ==(http://ruby-doc.org/core-2.1.2/Method.html#method-i-3D-3D) is too strict when also using BubbleWrap::KVO.
From ruby-doc.org:
If you begin observing an object after creating an event with a method(:), it can change the owner property of method(:) when you go to take off the event.
This change relaxes the definition of == for method objects for removal.