mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-04 12:14:29 +00:00
Move dealloc method from ASImageNode+AnimatedImage category to ASImageNode
Having a dealloc method in a category can be very problematic as the superclass dealloc method will not be called in case it exists.
This commit is contained in:
@@ -233,7 +233,11 @@ NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes;
|
||||
return frameIndex;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
@end
|
||||
|
||||
@implementation ASImageNode(AnimatedImageInvalidation)
|
||||
|
||||
- (void)invalidateAnimatedImage
|
||||
{
|
||||
ASDN::MutexLocker l(_displayLinkLock);
|
||||
#if ASAnimatedImageDebug
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -31,3 +31,10 @@ extern NSString *const ASAnimatedImageDefaultRunLoopMode;
|
||||
@property (atomic, assign) CFTimeInterval lastDisplayLinkFire;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface ASImageNode (AnimatedImageInvalidation)
|
||||
|
||||
- (void)invalidateAnimatedImage;
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user