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

Bugfix: cleanup didn't unswizzle classes that had already been swizzled #40

Merged
merged 1 commit into from
Apr 1, 2015

Conversation

fpillet
Copy link
Contributor

@fpillet fpillet commented Mar 31, 2015

This would happen when using other code that itself swizzles classes (i.e. ReactiveCocoa). For example, if a rac_signalForSelector was called on an object then later an aspect hook was installed and further removed, we would end up in a situation where Aspect's class swizzling (in-place swizzling of -forwardInvocation:) would never be ununstalled when the last hook was removed, later wrecking havoc with RAC's own use of -forwardInvocation.

In short, this pull request fixes hair-pulling crashes.

This would happen when using other code that itself swizzles classes (i.e. ReactiveCocoa). For example, if a rac_signalForSelector was called on an object then later an aspect hook was installed and further removed, we would end up in a situation where Aspect's class swizzling (in-place swizzling of -forwardInvocation:) would never be ununstalled when the last hook was removed, later wrecking havoc with RAC's own use of -forwardInvocation.

In short, this pull request fixes hair-pulling crashes.
@fpillet
Copy link
Contributor Author

fpillet commented Mar 31, 2015

To make things crystal clear, this fix properly reverts the -forwardInvocation swizzling done by:

https://github.com/steipete/Aspects/blob/master/Aspects.m#L358

@steipete
Copy link
Owner

steipete commented Apr 1, 2015

lgtm - thanks!

steipete added a commit that referenced this pull request Apr 1, 2015
Bugfix: cleanup didn't unswizzle classes that had already been swizzled
@steipete steipete merged commit 3fcc13a into steipete:master Apr 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants