diff --git a/doric-iOS/Pod/Classes/Shader/DoricImageNode.m b/doric-iOS/Pod/Classes/Shader/DoricImageNode.m index b8828125..0d1f0db2 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricImageNode.m +++ b/doric-iOS/Pod/Classes/Shader/DoricImageNode.m @@ -732,14 +732,6 @@ - (BOOL)needReload { return NO; } -- (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 - } - (NSDictionary *)getImageInfo { CGImageRef imageRef = [self.view.image CGImage]; return @{ @@ -771,4 +763,15 @@ - (NSData *)getImagePixels { return [[NSData alloc] initWithBytesNoCopy:imageData length:width * height * bytesPerPixel]; } + +- (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