diff --git a/React/CxxBridge/RCTCxxBridge.mm b/React/CxxBridge/RCTCxxBridge.mm index 42c3fdbf5..184612f1c 100644 --- a/React/CxxBridge/RCTCxxBridge.mm +++ b/React/CxxBridge/RCTCxxBridge.mm @@ -876,6 +876,9 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR - (void)reload { + if (!_valid) { + RCTLogError(@"Attempting to reload bridge before it's valid: %@. Try restarting the development server if connected.", self); + } [_parentBridge reload]; } diff --git a/React/Fabric/RCTSurfacePresenter.mm b/React/Fabric/RCTSurfacePresenter.mm index 9c9c15955..2c2f01c93 100644 --- a/React/Fabric/RCTSurfacePresenter.mm +++ b/React/Fabric/RCTSurfacePresenter.mm @@ -61,6 +61,11 @@ using namespace facebook::react; return self; } +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + - (void)schedulerDidComputeMutationInstructions:(facebook::react::TreeMutationInstructionList)instructions rootTag:(ReactTag)rootTag { [_mountingManager mutateComponentViewTreeWithMutationInstructions:instructions diff --git a/React/Fabric/Surface/RCTFabricSurface.mm b/React/Fabric/Surface/RCTFabricSurface.mm index 267ef61c0..5d8f5a1ed 100644 --- a/React/Fabric/Surface/RCTFabricSurface.mm +++ b/React/Fabric/Surface/RCTFabricSurface.mm @@ -90,6 +90,8 @@ - (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [self _stop]; }