Skip to content

Commit

Permalink
do not return BOOL for start and stop methods
Browse files Browse the repository at this point in the history
Summary:
Changelog: [Internal]

these are returning bools for some reason even though no one is using the returned value. changing them to return void

Reviewed By: RSNara

Differential Revision: D31594241

fbshipit-source-id: 04c115b573b74996eaf2fef631eedb12c6734ea8
  • Loading branch information
philIip authored and facebook-github-bot committed Oct 20, 2021
1 parent f1aabc5 commit 6acb18c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
6 changes: 2 additions & 4 deletions React/Base/Surface/RCTSurface.mm
Original file line number Diff line number Diff line change
Expand Up @@ -567,18 +567,16 @@ - (void)uiManagerDidPerformMounting:(__unused RCTUIManager *)manager
}
}

- (BOOL)start
- (void)start
{
// Does nothing.
// The Start&Stop feature is not implemented for regular Surface yet.
return YES;
}

- (BOOL)stop
- (void)stop
{
// Does nothing.
// The Start&Stop feature is not implemented for regular Surface yet.
return YES;
}

#pragma mark - Mounting/Unmounting of React components
Expand Down
5 changes: 2 additions & 3 deletions React/Base/Surface/RCTSurfaceProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ NS_ASSUME_NONNULL_BEGIN
@property (atomic, assign, readonly) CGSize intrinsicSize;

#pragma mark - Start & Stop

/**
* Starts or stops the Surface.
* Those methods are a no-op for regular RCTSurface (for now), but all call sites must call them appropriately.
*/
- (BOOL)start;
- (BOOL)stop;
- (void)start;
- (void)stop;

@end

Expand Down
11 changes: 4 additions & 7 deletions React/Fabric/Surface/RCTFabricSurface.mm
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ - (void)dealloc

#pragma mark - Life-cycle management

- (BOOL)start
- (void)start
{
std::lock_guard<std::mutex> lock(_surfaceMutex);

if (_surfaceHandler->getStatus() != SurfaceHandler::Status::Registered) {
return NO;
return;
}

// We need to register a root view component here synchronously because right after
Expand All @@ -108,15 +108,14 @@ - (BOOL)start
[self _propagateStageChange];

[_surfacePresenter setupAnimationDriverWithSurfaceHandler:*_surfaceHandler];
return YES;
}

- (BOOL)stop
- (void)stop
{
std::lock_guard<std::mutex> lock(_surfaceMutex);

if (_surfaceHandler->getStatus() != SurfaceHandler::Status::Running) {
return NO;
return;
}

_surfaceHandler->stop();
Expand All @@ -126,8 +125,6 @@ - (BOOL)stop
[self->_surfacePresenter.mountingManager detachSurfaceFromView:self.view
surfaceId:self->_surfaceHandler->getSurfaceId()];
});

return YES;
}

#pragma mark - Immutable Properties (no need to enforce synchronization)
Expand Down

0 comments on commit 6acb18c

Please sign in to comment.