-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
在 ImageDownloader 里 session 是一个 strong property
private var session: NSURLSession?
在 ImageDownloader 的 init 里
session = NSURLSession(configuration: sessionConfiguration, delegate: self, delegateQueue: NSOperationQueue.mainQueue())
NSURLSession 的文档提到
IMPORTANT
The session object keeps a strong reference to the delegate until your app exits or explicitly invalidates the session. If you do not invalidate the session by calling the invalidateAndCancel or finishTasksAndInvalidate method, your app leaks memory until it exits.
defaultDownloader 是不会 deinit 的单例所以不影响,但是如果自定义 ImageDownloader 有可能会造成内存泄露
Metadata
Metadata
Assignees
Labels
No labels
Projects
Milestone
Relationships
Development
Select code repository
Activity
onevcat commentedon Feb 15, 2016
Should be fixed in #236