Procházet zdrojové kódy

Fix Xcode warnings

ibireme před 8 roky
rodič
revize
c80e399703
1 změnil soubory, kde provedl 2 přidání a 3 odebrání
  1. 2 3
      YYImage/YYAnimatedImageView.m

+ 2 - 3
YYImage/YYAnimatedImageView.m

@@ -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(