fix(ios) remove observers on dealloc for RCTDeviceInfo

This commit is contained in:
Saúl Ibarra Corretgé 2022-11-25 14:46:09 +01:00
parent a711a0e4bb
commit b84bb7d64b
1 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,19 @@
diff --git a/node_modules/react-native/React/CoreModules/RCTDeviceInfo.mm b/node_modules/react-native/React/CoreModules/RCTDeviceInfo.mm
index 8e21fa5..f9dfb5f 100644
--- a/node_modules/react-native/React/CoreModules/RCTDeviceInfo.mm
+++ b/node_modules/react-native/React/CoreModules/RCTDeviceInfo.mm
@@ -70,6 +70,11 @@ - (void)initialize
object:nil];
}
+- (void)dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
+
static BOOL RCTIsIPhoneX()
{
static BOOL isIPhoneX = NO;
diff --git a/node_modules/react-native/React/CoreModules/RCTTiming.mm b/node_modules/react-native/React/CoreModules/RCTTiming.mm diff --git a/node_modules/react-native/React/CoreModules/RCTTiming.mm b/node_modules/react-native/React/CoreModules/RCTTiming.mm
index 13d0d57..00e5d4c 100644 index 13d0d57..00e5d4c 100644
--- a/node_modules/react-native/React/CoreModules/RCTTiming.mm --- a/node_modules/react-native/React/CoreModules/RCTTiming.mm