diff --git a/React/Modules/RCTDeviceInfo.m b/React/Modules/RCTDeviceInfo.m index 6b82a933d..1baab7551 100644 --- a/React/Modules/RCTDeviceInfo.m +++ b/React/Modules/RCTDeviceInfo.m @@ -86,6 +86,11 @@ static NSDictionary *RCTExportedDimensions(RCTBridge *bridge) }; } +- (void)dealloc +{ + [NSNotificationCenter.defaultCenter removeObserver:self]; +} + - (void)invalidate { RCTExecuteOnMainQueue(^{ diff --git a/React/Modules/RCTUIManager.m b/React/Modules/RCTUIManager.m index d4aac0032..5984c972e 100644 --- a/React/Modules/RCTUIManager.m +++ b/React/Modules/RCTUIManager.m @@ -79,6 +79,11 @@ RCT_EXPORT_MODULE() return NO; } +- (void)dealloc +{ + [NSNotificationCenter.defaultCenter removeObserver:self]; +} + - (void)invalidate { /**