AMTumblrHud icon indicating copy to clipboard operation
AMTumblrHud copied to clipboard

memory issue in method

Open shattars3d opened this issue 6 years ago • 3 comments

hey , the method doAnimateCycleWithRects.

the _weak is not needed //__weak typeof(self) wSelf = self; //weak issue should be typeof(self) wSelf = self;

  • (void)doAnimateCycleWithRects:(NSArray *)rects { //__weak typeof(self) wSelf = self; //weak issue

    typeof(self) wSelf = self;

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (0.25 * 0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [wSelf animateRect:rects[0] withDuration:0.25]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (0.25 * 0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [wSelf animateRect:rects[1] withDuration:0.2]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (0.2 * 0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [wSelf animateRect:rects[2] withDuration:0.15]; }); }); }); dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (0.6 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [wSelf doAnimateCycleWithRects:rects]; }); }

shattars3d avatar Mar 08 '18 20:03 shattars3d

@Asich how come you re opened the issue?

shattars3d avatar Jun 11 '18 15:06 shattars3d

@shattars3d Accidentally) Are you sure that there is no need for "weak"? How did you come up with it? How did you check that?

Asich avatar Jun 13 '18 10:06 Asich

well i think depending in the developer is using are or not... I'm using arc so I personally wouldn't need to too call the extra _weak

shattars3d avatar Jun 13 '18 15:06 shattars3d