Skip to content

Commit

Permalink
Remove old animation layer when creating a new animation layer (#2214)
Browse files Browse the repository at this point in the history
  • Loading branch information
junjielu authored Oct 18, 2023
1 parent ae48d2a commit 3421eeb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Sources/Public/Animation/LottieAnimationLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,7 @@ public class LottieAnimationLayer: CALayer {

if let oldAnimation = animationLayer {
oldAnimation.removeFromSuperlayer()
rootAnimationLayer = nil
}

guard let animation = animation else {
Expand Down

0 comments on commit 3421eeb

Please sign in to comment.