Commit Graph

18 Commits

Author SHA1 Message Date
Olivier Poitrey 4792909c5b Merge pull request #29 from nonamelive/patch-1
Fixed a potential crash when the delegate retainCount = 1, which means th
2011-10-03 07:18:06 -07:00
Olivier Poitrey 7d0e544c50 Add an option to disable on disk caching (fix #16) + refactor other options (low prio and retry failed) to an options: parameter 2011-10-03 15:54:49 +02:00
Olivier Poitrey 7c06b3a314 Failsafe a very common usage error (passing URL as NSString instead of NSURL) 2011-10-01 00:38:44 +02:00
nonamelive 2b0bb248f4 Fixed a potential crash when the delegate retainCount = 1, which means the delegate is only retained by the SDWebImageManager and the delegate's dealloc method has a structure like the code below.
- (void)dealloc
{
    [manager cancelForDelegate:self];
    [super dealloc];
}
2011-09-28 14:29:51 +08:00
Adam Ernst 45cc126d32 Fix race condition with SDWebImageManager's cancelForDelegate:
The -cancelForDelegate: method was working for downloads but not local cache checks. Add some new machinery to keep track of pending cache requests and only message the delegate if it hasn't since requested cancellation.
2011-07-13 23:03:36 +02:00
Olivier Poitrey 47aad5b55f Fix some implicit conversion warnings 2011-07-13 21:55:34 +02:00
Olivier Poitrey 4005884df5 Fix coding style 2011-07-13 21:23:13 +02:00
Jeppe Vesterbæk 34e8082cde Add low priority download mode. Low priorities run NSUrlConnection in NSEventTrackingRunLoopMode 2011-05-06 10:30:50 +02:00
Olivier Poitrey 44fd72843b Clean delegates even on failed downloads 2011-03-21 16:40:09 +01:00
Elio Gonzalez ee153fee04 Force retry of failed downloads 2011-01-25 03:37:04 +01:00
Olivier Poitrey 2b352c3c3a Perform disk cache out operations asynchronousely in order to prevent from blocking the main runloop when a lot of cache queries are performed at the same time 2010-09-16 22:56:11 +02:00
Olivier Poitrey d2dc4cbbac Do not convert images to JPEG when stored to disk for caching
This saves CPU and memory in all cases and alpha channel / image clearness if orignal format was PNG or GIF.
2010-08-29 03:22:20 +02:00
Olivier Poitrey e0e369659e Replace the NSOperation based downloader by a simple async NSURLConnection (read-on to understand why)
I finally found the reason behind the download not started while UITableView is manipulated: the default NSURLConnection runloop mode. Its default mode is NSEventTrackingRunLoopMode which is interrupted by UI events. Changing default NSURLConnection runloop mode to NSRunLoopCommonModes just fix this good old responsiveness issue.

I thus decided to replace the current NSOperation based implementation by this finding, as NSOperation is far more expensive than simple async connections. Additionally, moving aways from NSOperation here fix an odd lagging issue with iOS 4, an issue I can't explain at the moment.

Note that `SDWebImageDownloader`'s `setMaxConcurrentDownloads:` method is now a no-op as I didn't implemented the NSOperation queuing system with async connections. I don't think it still necessary as thread-less async connectaions are very lightweight. If you think there is a real need of this, I may reconsider and implement it in the future. In the meantime, this method does nothing and its usage is declared as deprecated.
2010-06-09 04:36:18 +02:00
Olivier Poitrey 58a24963b5 Set references to nil after release in dealloc methods 2010-06-02 01:37:39 +02:00
Olivier Poitrey a230f6aba8 Handle nil image urls nicely 2009-12-31 14:12:50 +01:00
Olivier Poitrey 0bdd448ca8 Fix some warnings when most warnings are activated 2009-11-11 15:43:11 +01:00
Olivier Poitrey 79c5fa177d Fix the name of the SDWebImageManagerDelegate protocol 2009-09-28 23:56:24 +02:00
Olivier Poitrey 2fa0626aaa Remove the dirty hack of storing the helper into the first subview of the UIImageView and prevent duplicate downloads of the same URL
The helper (now called manager) is now handling the mapping between the UIImageView and its downloader.
This way we don't polute the UIImageView, and don't remove its capability to have subviews.
This change removes the automatic handling of image placeholder. The placeholder image can
be passed as second argument of setImageWithURL:placeholderImage:
The manager now handle duplicate downloads for the same URL gracefuly by sharing the same downloader
for all requestors.
Finaly, the manager handles URLs which can't create an image (HTTP error or invalid format) by flagging
them so it won't retry to download them again and again.
2009-09-24 02:35:14 +02:00