-
Notifications
You must be signed in to change notification settings - Fork 1k
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
momery leak #27
Comments
There's a line If there are other references to self, then dealloc is called and no leaks occur. Are you actually getting a leak? If so, how? I'm not able to produce a leak, and I get no analyser warnings. One easy way to test is to place a breakpoint inside the dealloc method. |
sorry, i mean dealloc method will never calls. |
In your example, the ActionSheetTatePicker will deallocate after you call showActionSheetPicker and it is dismissed. The selfReference is released and set to nil when the ActionSheetPicker is dismissed. If the ActionSheetPicker is never dismissed (nor presented) then indeed, it won't be released. To avoid this situation, don't create one unless you intend on presenting it. |
In this case, the ActionSheetPicker will release soon after being dismissed. Set a breakpoint on the dealloc method for verification. |
I know. PS: In my example i do not call showAcionSheetPicker, because i want to show you memory leak |
when you set selfReference
self.selfReference = self;
release method will never calls
The text was updated successfully, but these errors were encountered: