Skip to content

Commit

Permalink
fix(ios): resolve a multithreading issue in Animator
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Jun 27, 2024
1 parent 61ea1a1 commit 9ab6119
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ios/sdk/module/animation2/pop/HPOPAnimator.mm
Original file line number Diff line number Diff line change
Expand Up @@ -532,21 +532,21 @@ - (void)_scheduleProcessPendingList
pthread_mutex_unlock(&_lock);
}

- (void)_renderTime:(CFTimeInterval)time items:(std::list<POPAnimatorItemRef>)items
- (void)_renderTime:(CFTimeInterval)time items:(std::list<POPAnimatorItemRef> &)items
{
// begin transaction with actions disabled
[CATransaction begin];
[CATransaction setDisableActions:YES];

// lock
pthread_mutex_lock(&_lock);

// notify delegate
NSArray *allDelegates = _animatorDelegates.allObjects;
for (id<HPOPAnimatorDelegate> delegate in allDelegates) {
[delegate animatorWillAnimate:self];
}

// lock
pthread_mutex_lock(&_lock);

// count active animations
const NSUInteger count = items.size();
if (0 == count) {
Expand Down

0 comments on commit 9ab6119

Please sign in to comment.