Skip to content

Commit bad1a87

Browse files
committed
Merge pull request m1entus#79 from PrideChung/master
Check alreadyUpdating before setting contentInset to prevent potential infinite loop
2 parents 546e1b8 + be82b3d commit bad1a87

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

INSPullToRefresh/INSPullToRefreshBackgroundView.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,7 @@ - (void)setScrollViewContentInset:(UIEdgeInsets)contentInset {
380380
BOOL alreadyUpdating = _updatingScrollViewContentInset; // Check to prevent errors from recursive calls.
381381
if (!alreadyUpdating) {
382382
self.updatingScrollViewContentInset = YES;
383-
}
384-
self.scrollView.contentInset = contentInset;
385-
if (!alreadyUpdating) {
383+
self.scrollView.contentInset = contentInset;
386384
self.updatingScrollViewContentInset = NO;
387385
}
388386
}

0 commit comments

Comments
 (0)