mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Trigger garbage collection when the app receive memory warning
Summary: Changelog: [internal] The condition inside `[RCTCxxBridge handleMemoryWarning]` was preventing JS VM from handling memory pressure if React Native was loading. This seems incorrect as loading only occurs once at the startup but memory pressure event occurs mostly after React Native was initialised. Therefore, JS VM wasn't handling memory pressure events. Reviewed By: shergin Differential Revision: D24646724 fbshipit-source-id: 7b4420fe675261e434c3427c8ad366ba0086a453
This commit is contained in:
committed by
Facebook GitHub Bot
parent
be8fe21d06
commit
96ecad4341
@@ -310,7 +310,9 @@ struct RCTInstanceCallback : public InstanceCallback {
|
||||
|
||||
- (void)handleMemoryWarning
|
||||
{
|
||||
if (!_valid || !_loading) {
|
||||
// We only want to run garbage collector when the loading is finished
|
||||
// and the instance is valid.
|
||||
if (!_valid || _loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user