From 7c640e9eb4e9b2989e44f6e128a0984434c7d12e Mon Sep 17 00:00:00 2001 From: Asif Bilal Date: Mon, 26 Nov 2018 21:25:45 +0500 Subject: [PATCH] Fixed #164 (Memory Leak issue) --- .../MZFormSheetPresentationController.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MZFormSheetPresentationController/MZFormSheetPresentationController.m b/MZFormSheetPresentationController/MZFormSheetPresentationController.m index 635f73c..02c0ae2 100644 --- a/MZFormSheetPresentationController/MZFormSheetPresentationController.m +++ b/MZFormSheetPresentationController/MZFormSheetPresentationController.m @@ -207,8 +207,9 @@ - (void)setupBackgroundBlurView { #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 if ([UIViewPropertyAnimator class]) { + __weak MZFormSheetPresentationController *weakSelf = self; self.propertyAnimator = [[UIViewPropertyAnimator alloc] initWithDuration:1.0 curve:UIViewAnimationCurveLinear animations:^{ - self.blurBackgroundView.effect = nil; + weakSelf.blurBackgroundView.effect = nil; }]; } #endif