Skip to content

Commit e7ef992

Browse files
sherginfacebook-github-bot
authored andcommitted
Fabric: Fixing crash in RCTScrollViewComponentView (2nd attempt)
Summary: Seems a ScrollView sometimes calls the delegate in own destructor; and seems that in some configurations the delegate is also already destroyed at this point. I am not sure if this a bug in UIKit or not, but seems the fix is easy, we just have to clear the ScrollView's delegate on the delegate's deallocation. This issue is also looks similar: https://stackoverflow.com/questions/18778691/crash-on-exc-breakpoint-scroll-view/19011871 Changelog: [iOS] [Fixed] - Fixed crash in RCTScrollViewComponentView Reviewed By: sammy-SC Differential Revision: D17924429 fbshipit-source-id: 5727bca9f028e28f76f60304c187ee39eb6e1856
1 parent beae6d6 commit e7ef992

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm

+2-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ - (instancetype)initWithFrame:(CGRect)frame
8585

8686
- (void)dealloc
8787
{
88-
[_scrollViewDelegateSplitter removeDelegate:self];
88+
// This is not strictly necessary but that prevents a crash caused by a bug in UIKit.
89+
_scrollView.delegate = nil;
8990
}
9091

9192
#pragma mark - RCTComponentViewProtocol

0 commit comments

Comments
 (0)