Fix overlapping accesses to image container

This commit is contained in:
Michael Schneider 2018-04-27 08:01:21 -07:00 committed by Reda Lemeden
parent 2e196c221e
commit 2e316954d8
1 changed files with 2 additions and 1 deletions

View File

@ -189,7 +189,8 @@ extension GIFAnimatable {
/// Updates the image with a new frame if necessary.
public func updateImageIfNeeded() {
if var imageContainer = self as? ImageContainer {
imageContainer.image = activeFrame ?? imageContainer.image
let container = imageContainer
imageContainer.image = activeFrame ?? container.image
} else {
layer.contents = activeFrame?.cgImage
}