iOS: image removeObserver when reset
This commit is contained in:
parent
5eb47355e0
commit
c6d26c1f49
@ -683,6 +683,14 @@ - (void)reset {
|
||||
self.imageScale = UIScreen.mainScreen.scale;
|
||||
self.blurEffectView = nil;
|
||||
self.view.contentMode = UIViewContentModeScaleAspectFill;
|
||||
if (self.animationEndCallbackId) {
|
||||
#if DORIC_USE_YYWEBIMAGE
|
||||
[(DoricImageView *) self.view removeObserver:self forKeyPath:@"currentIsPlayingAnimation" context:nil];
|
||||
#elif DORIC_USE_SDWEBIMAGE
|
||||
[(DoricImageView *) self.view removeObserver:self forKeyPath:@"currentFrameIndex" context:nil];
|
||||
#endif
|
||||
self.animationEndCallbackId = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)needReload {
|
||||
@ -697,10 +705,12 @@ - (BOOL)needReload {
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
if (self.animationEndCallbackId) {
|
||||
#if DORIC_USE_YYWEBIMAGE
|
||||
[(DoricImageView *) self.view removeObserver:self forKeyPath:@"currentIsPlayingAnimation" context:nil];
|
||||
#elif DORIC_USE_SDWEBIMAGE
|
||||
[(DoricImageView *) self.view removeObserver:self forKeyPath:@"currentFrameIndex" context:nil];
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
Reference in New Issue
Block a user