-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
RCTBridge never dealloc #15462
Comments
Probably fixed in 1f9fc0e . |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
same issue, The ViewController and RCTRootView has been released, but RCTBridge never. |
still on 0.53.0 |
still on 0.51.0 |
We must set [_bridge invalidate] so that the relative resource can be release |
Same issue with version 0.54.2, RCTBridge cannot be dealloced // RCTRootView.m
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[_contentView invalidate];
// Add following codes
[_bridge invalidate];
_bridge = nil;
} But it seems RN doesn't want to fix this issue |
still on 0.55.4 But I don't agree with @seuzxh solution, that is because bridge maybe used to multi RCTRootView. |
still on 0.56.0 lol wtf |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
react-native -v
: 0.47.0node -v
: v8.1.2npm -v
: 5.3.0yarn --version
: not useThen, specify:
Steps to Reproduce
(Write your steps here:)
1.create new project
react-native init demo
2. create a new ViewController, and delete all the code in AppDelegate
3.add the RCTRootView to ViewController
4、run the project
Expected Behavior
When the ViewController has been popped from UINavigationController, the RCTRootView and RCTBridge has to call dealloc methos
Actual Behavior
ViewController and RCTRootView has called dealloc method, but RCTBridge hasn't call dealloc, become leak.
I use debug memory graph, it shows ViewControll and RCTRootView has been released, but when open ViewController again and again, the number of RCTBrigde will increase, the memory also increase
Reproducible Demo
Demo Link
I try to fix the issue, add [_bridge invalidate] to RCTRootView dealloc method. It works, RCTBridge calls dealloc methods when RCTRootView dealloc.
The text was updated successfully, but these errors were encountered: