Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DelegateProxy bugfixes + test cases #3425

Merged
merged 5 commits into from
Mar 30, 2017
Merged

DelegateProxy bugfixes + test cases #3425

merged 5 commits into from
Mar 30, 2017

Conversation

andersio
Copy link
Member

@andersio andersio commented Mar 30, 2017

  1. 6b38abc fixed the crash when setting DelegateProxy.forwardee to nil.

  2. d0b874f changed DelegateProxy to always complete its signals when the delegator has deinitialized. The current version would not have the signals completed if the proxy is retained externally (w.r.t. DelegateProxy.proxy).

  3. a9631a0 fixed a false negative in DelegateProxy.responds(to:), which causes it not reporting an implemented requirement in a circumstance.

  4. 79add39 added a bunch of test cases for DelegateProxy.

  5. f21fb2b was a minor refactoring.

let proxy = object.associations.value(forKey: key)!
proxy.forwardee = (delegate as! Delegate)
proxy.forwardee = (delegate as! Delegate?)
Copy link
Member Author

@andersio andersio Mar 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the culprit. @akashivskyy reported a EXC_BAD_ACCESS trap in the [UISearchController dealloc], which uncovered the mishandling of the optional argument here.

@andersio andersio changed the title Fixed an bug preventing the forwardee from being cleared in DelegateProxy. [WIP] DelegateProxy bugfixes Mar 30, 2017
@andersio andersio changed the title [WIP] DelegateProxy bugfixes DelegateProxy bugfixes + test cases Mar 30, 2017
@andersio andersio requested a review from mdiep March 30, 2017 11:42
It happened on a selector when the proxy has a forwardee, is implemented by the forwardee and is not implemented by the proxy.
@mdiep
Copy link
Contributor

mdiep commented Mar 30, 2017

Nicely done. 👏

@mdiep mdiep merged commit 2bbc723 into master Mar 30, 2017
@mdiep mdiep deleted the delegate-proxy-bugfix branch March 30, 2017 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants