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

Commit

Permalink
Release source and properties
Browse files Browse the repository at this point in the history
  • Loading branch information
bahlo committed Jun 10, 2014
1 parent ecc817e commit f91cc5e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions swift-gif/Gif.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ extension UIImage {
class func animatedImageWithData(data: NSData) -> UIImage? {
let source = CGImageSourceCreateWithData(data, nil).takeRetainedValue()
let image = UIImage.animatedImageWithSource(source)
// CFRelease(source) // We need to do this, because source is from type Unmanaged<CGImageSource>
CFRelease(source) // We need to do this, because source is from type Unmanaged<CGImageSource>

println(image)
return image
}

Expand All @@ -42,7 +41,7 @@ extension UIImage {
delay = 0.1 // Make sure, they're not too fast
}

// CFRelease(cfProperties)
CFRelease(cfProperties)

return delay
}
Expand Down Expand Up @@ -138,11 +137,6 @@ extension UIImage {
// Heyhey
let animation = UIImage.animatedImageWithImages(frames, duration: Double(duration) / 1000.0)

// Free resources
for var i = images.count - 1; i > 0; --i {
// CGImageRelease(images[i])
}

return animation
}

Expand Down

0 comments on commit f91cc5e

Please sign in to comment.