Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #77 from kodelit/patch-1
Browse files Browse the repository at this point in the history
Memory Leak Fix
  • Loading branch information
bahlo committed Dec 28, 2018
2 parents e01d5df + 13cd885 commit 6c9c56d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions SwiftGifCommon/UIImage+Gif.swift
Expand Up @@ -94,6 +94,9 @@ extension UIImage {
// Get dictionaries
let cfProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil)
let gifPropertiesPointer = UnsafeMutablePointer<UnsafeRawPointer?>.allocate(capacity: 0)
defer {
gifPropertiesPointer.deallocate()
}
if CFDictionaryGetValueIfPresent(cfProperties, Unmanaged.passUnretained(kCGImagePropertyGIFDictionary).toOpaque(), gifPropertiesPointer) == false {
return delay
}
Expand Down

0 comments on commit 6c9c56d

Please sign in to comment.