DAProgressOverlayView icon indicating copy to clipboard operation
DAProgressOverlayView copied to clipboard

timer not set to nil after invalidated, result in memory leak!

Open Quanhua-Guan opened this issue 7 years ago • 0 comments

timer not set to nil after invalidated, result in memory leak!

- (void)update
{
    CGFloat animationProggress = self.animationProggress + DAUpdateUIFrequency / self.stateChangeAnimationDuration;
    if (animationProggress >= 1.) {
        self.animationProggress = 1.;
        [self.timer invalidate];
        self.timer = nil;// ADD THIS LINE RESOLVE THE ISSUE
    } else {
        self.animationProggress = animationProggress;
    }
    [self setNeedsDisplay];
}

Quanhua-Guan avatar Aug 21 '17 07:08 Quanhua-Guan