Reset module registry flag when resetting React Instance

Summary:
D12911108 fixed a UBN race condition by adding a flag for module registry.

This flag was never reset if react instance gets reset, causing an assert to fire in IG.

Reviewed By: fkgozali

Differential Revision: D13010651

fbshipit-source-id: e20453f3c546d759a58fd7fb93553f774410905f
This commit is contained in:
Peter Argany 2018-11-09 17:11:58 -08:00 committed by Facebook Github Bot
parent 2bf0d54f15
commit 188cbb04ad
1 changed files with 2 additions and 0 deletions

View File

@ -880,6 +880,7 @@ struct RCTInstanceCallback : public InstanceCallback {
_loading = NO;
_valid = NO;
_moduleRegistryCreated = NO;
dispatch_async(dispatch_get_main_queue(), ^{
if (self->_jsMessageThread) {
@ -976,6 +977,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR
_loading = NO;
_valid = NO;
_didInvalidate = YES;
_moduleRegistryCreated = NO;
if ([RCTBridge currentBridge] == self) {
[RCTBridge setCurrentBridge:nil];