Skip to content

Commit

Permalink
Attempt to fix a crash in Scheduler::uiManagerDidCloneShadowNode
Browse files Browse the repository at this point in the history
Summary:
changelog: [internal]

Attempt at fixing a crash in `Scheduler::uiManagerDidCloneShadowNode` by setting delegate to nullptr explicitly.

I don't think this will make a difference because `scheduler_` is released at the end of `dealloc` but it is worth a shot. Maybe some complex interaction between Obj-C and C++ comes into play here.

In this diff I also removed `_animationDriver = nullptr` because dealloc will do that automatically.

Reviewed By: philIip

Differential Revision: D32720901

fbshipit-source-id: 227ced2331384c47e8d15a323ee8a621bbb3d179
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Dec 1, 2021
1 parent f3bf2e4 commit 1989ad3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion React/Fabric/RCTScheduler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ - (void)dealloc
if (_animationDriver) {
_animationDriver->setLayoutAnimationStatusDelegate(nullptr);
}
_animationDriver = nullptr;

_scheduler->setDelegate(nullptr);
}

- (void)registerSurface:(facebook::react::SurfaceHandler const &)surfaceHandler
Expand Down

0 comments on commit 1989ad3

Please sign in to comment.