Merge pull request #1871 from maicki/MSMoveDeallocASImgeNode

[ASImageNode] Move dealloc method from ASImageNode+AnimatedImage category to ASImageNode
This commit is contained in:
Adlai Holler
2016-07-08 15:20:06 -07:00
committed by GitHub
3 changed files with 18 additions and 1 deletions

View File

@@ -233,7 +233,11 @@ NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes;
return frameIndex;
}
- (void)dealloc
@end
@implementation ASImageNode(AnimatedImageInvalidation)
- (void)invalidateAnimatedImage
{
ASDN::MutexLocker l(_displayLinkLock);
#if ASAnimatedImageDebug

View File

@@ -110,6 +110,12 @@ struct ASImageNodeDrawParameters {
return nil;
}
- (void)dealloc
{
// Invalidate all components around animated images
[self invalidateAnimatedImage];
}
#pragma mark - Layout and Sizing
- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize

View File

@@ -31,3 +31,10 @@ extern NSString *const ASAnimatedImageDefaultRunLoopMode;
@property (atomic, assign) CFTimeInterval lastDisplayLinkFire;
@end
@interface ASImageNode (AnimatedImageInvalidation)
- (void)invalidateAnimatedImage;
@end