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

Fix issue : Exc_bad_access call instance error in hook callback #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tuxi
Copy link

@tuxi tuxi commented May 25, 2017

Hello:
Problem Description: when I hook the viewDidDisappear: method in the callback when I use the callback information AspectInfo instance, always exc_bad_access error, I find the source and solve the trouble, you can see
the use of unsafe_unretained'instance'in AspectInfo class modified member properties,
when the callback if the object referred to by'instance' was released at this time because of the characteristics of unsafe_unretained,
the object to which instance points is not set to nil, exc_bad_access will eventually lead to errors when used outside,
I modified to solve the problem for weak;
@property (nonatomic, weak, readonly) id instance;

the use of unsafe_unretained'instance'in AspectInfo class modified member properties,
when the callback if the object referred to by'instance' was released at this time because of the characteristics of unsafe_unretained,
 the object to which instance points is not set to nil, exc_bad_access will eventually lead to errors when used outside,
 I modified to solve the problem for weak;
@Property (nonatomic, weak, readonly) id instance;
@tuxi tuxi changed the title To solve the problem: Exc_bad_access call instance error in hook callback May 25, 2017
@tuxi tuxi changed the title Exc_bad_access call instance error in hook callback Fix issue : Exc_bad_access call instance error in hook callback May 25, 2017
@tuxi tuxi closed this May 26, 2017
@tuxi tuxi reopened this May 30, 2017
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.

None yet

1 participant