m1entus / MZFormSheetPresentationController

MZFormSheetPresentationController provides an alternative to the native iOS UIModalPresentationFormSheet, adding support for iPhone and additional opportunities to setup UIPresentationController size and feel form sheet.
MIT License
973 stars 146 forks source link

Memory Leak issue #164

Open asifbilal786 opened 5 years ago

asifbilal786 commented 5 years ago

Hi

First thanks for the great library. It's really useful.

But I am facing the memory leaks when using this library. I have debug into the code and came to know that this code is causing memory leak.

self.propertyAnimator = [[UIViewPropertyAnimator alloc] initWithDuration:1.0 curve:UIViewAnimationCurveLinear animations:^{ self.blurBackgroundView.effect = nil; }];

To resolve it I have changed it to weak self as instructed by Apple to avoid any memory issue.

__weak MZFormSheetPresentationController *weakSelf = self; self.propertyAnimator = [[UIViewPropertyAnimator alloc] initWithDuration:1.0 curve:UIViewAnimationCurveLinear animations:^{ weakSelf.blurBackgroundView.effect = nil; }];

Please update the pod with resolution of this issue. Thanks!!!

m1entus commented 5 years ago

Thanks, thats true, this is a memory leak, can you make PR ?

asifbilal786 commented 5 years ago

I have created Pull Request for this issue. Please accept this.

m1entus commented 5 years ago

Don't see Pull Request, you probably only have added commit to your repo