Skip to content

Commit

Permalink
Make RCTUIManager and RCTDeviceInfo unsubscribe from NSNotificationCe…
Browse files Browse the repository at this point in the history
…nter on

Reviewed By: fromcelticpark

Differential Revision: D5986167

fbshipit-source-id: 18131572361c4b3f5e0ed5c8f97833a21902cad1
  • Loading branch information
Dmitry Zakharov authored and facebook-github-bot committed Oct 10, 2017
1 parent bbc3f60 commit 04ff184
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions React/Modules/RCTDeviceInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ static BOOL RCTIsIPhoneX() {
};
}

- (void)dealloc
{
[NSNotificationCenter.defaultCenter removeObserver:self];
}

- (void)invalidate
{
RCTExecuteOnMainQueue(^{
Expand Down
5 changes: 5 additions & 0 deletions React/Modules/RCTUIManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ + (BOOL)requiresMainQueueSetup
return NO;
}

- (void)dealloc
{
[NSNotificationCenter.defaultCenter removeObserver:self];
}

- (void)invalidate
{
/**
Expand Down

0 comments on commit 04ff184

Please sign in to comment.