소스 검색

destroy pthread_mutex on dealloc

ibireme 9 년 전
부모
커밋
15707d2ed0
3개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      YYWebImage/Cache/YYMemoryCache.m
  2. 1 1
      YYWebImage/Image/YYAnimatedImageView.m
  3. 1 0
      YYWebImage/Image/YYImageCoder.m

+ 1 - 0
YYWebImage/Cache/YYMemoryCache.m

@@ -352,6 +352,7 @@ static inline dispatch_queue_t YYMemoryCacheGetReleaseQueue() {
     [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
     [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil];
     [_lru removeAll];
+    pthread_mutex_destroy(&_lock);
 }
 
 - (NSUInteger)totalCount {

+ 1 - 1
YYWebImage/Image/YYAnimatedImageView.m

@@ -620,7 +620,7 @@ typedef NS_ENUM(NSUInteger, YYAnimatedImageType) {
     _runloopMode = runloopMode.copy;
 }
 
-#pragma mark - Overrice NSObject(NSKeyValueObservingCustomization)
+#pragma mark - Override NSObject(NSKeyValueObservingCustomization)
 
 + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key {
     if ([key isEqualToString:@"currentAnimatedImageIndex"]) {

+ 1 - 0
YYWebImage/Image/YYImageCoder.m

@@ -1530,6 +1530,7 @@ CGImageRef YYCGImageCreateWithWebPData(CFDataRef webpData,
     if (_webpSource) WebPDemuxDelete(_webpSource);
 #endif
     if (_blendCanvas) CFRelease(_blendCanvas);
+    pthread_mutex_destroy(&_lock);
 }
 
 + (instancetype)decoderWithData:(NSData *)data scale:(CGFloat)scale {