From 04ff184c12e48f683c5758556917b7a41e7d2e65 Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Tue, 10 Oct 2017 04:58:13 -0700 Subject: [PATCH] Make RCTUIManager and RCTDeviceInfo unsubscribe from NSNotificationCenter on Reviewed By: fromcelticpark Differential Revision: D5986167 fbshipit-source-id: 18131572361c4b3f5e0ed5c8f97833a21902cad1 --- React/Modules/RCTDeviceInfo.m | 5 +++++ React/Modules/RCTUIManager.m | 5 +++++ 2 files changed, 10 insertions(+) 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 { /**