|
@@ -124,7 +124,6 @@ typedef NS_ENUM(NSUInteger, YYAnimatedImageType) {
|
|
|
@package
|
|
|
UIImage <YYAnimatedImage> *_curAnimatedImage;
|
|
|
|
|
|
- dispatch_once_t _onceToken;
|
|
|
dispatch_semaphore_t _lock; ///< lock for _buffer
|
|
|
NSOperationQueue *_requestQueue; ///< image request queue, serial
|
|
|
|
|
@@ -231,7 +230,7 @@ typedef NS_ENUM(NSUInteger, YYAnimatedImageType) {
|
|
|
|
|
|
// init the animated params.
|
|
|
- (void)resetAnimated {
|
|
|
- dispatch_once(&_onceToken, ^{
|
|
|
+ if (!_link) {
|
|
|
_lock = dispatch_semaphore_create(1);
|
|
|
_buffer = [NSMutableDictionary new];
|
|
|
_requestQueue = [[NSOperationQueue alloc] init];
|
|
@@ -244,7 +243,7 @@ typedef NS_ENUM(NSUInteger, YYAnimatedImageType) {
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMemoryWarning:) name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil];
|
|
|
- });
|
|
|
+ }
|
|
|
|
|
|
[_requestQueue cancelAllOperations];
|
|
|
LOCK(
|