Reputation: 847
I am creating a App that uses React Native in some part, but not all.
I have an instance of RCTRootView
Setting it to nil
and removing it from the superview doesn't seem to release it.
The CPU and RAM stays high, so it seems the React app stills executing on the threads.
How can I stop it?
Thanks :)
Upvotes: 13
Views: 2845
Reputation: 2041
RCTBridge * bridge
[bridge invalidate];
bridge = nil;
invalidate and nil will clear all modules from jsbundle and it clears RCTRootView instances from memory . Note bridge is object of RCTBridge.
Upvotes: 5
Reputation: 847
You have to create your own RTCBridge separately and release it ( = nil), not only the view.
Upvotes: 4