Call stopObserving on correct queue

Summary:
Since `dealloc` can be called from any thread, this would result `stopObserving` being called on a different thread/queue than the specified `methodQueue`. We specifically encountered this issue with a module needing the main queue having its `stopObserving` called on a background queue.

Changelog:
[iOS][Fixed] - Call [RCTEventEmitter stopObserving] on specified method queue

Reviewed By: RSNara

Differential Revision: D23821741

fbshipit-source-id: 693c3be6876f863da6dd214a829af2cc13a09c3f
This commit is contained in:
Scott Kyle
2020-09-21 17:30:34 -07:00
committed by Facebook GitHub Bot
parent 18f29db5a7
commit 23717e48af
9 changed files with 13 additions and 9 deletions
@@ -46,6 +46,7 @@ RCT_EXPORT_MODULE();
- (void)invalidate
{
[super invalidate];
[_nodesManager stopAnimationLoop];
[self.bridge.eventDispatcher removeDispatchObserver:self];
[self.bridge.uiManager.observerCoordinator removeObserver:self];