Răsfoiți Sursa

destroy pthread_mutex on dealloc

ibireme 9 ani în urmă
părinte
comite
15707d2ed0

+ 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 {