Commit d402958e authored by zyy's avatar zyy

添加强引用,以免对象被释放掉所带来的异常

parent e70691b7
...@@ -213,9 +213,11 @@ ...@@ -213,9 +213,11 @@
previewVc.currentIndex = index; previewVc.currentIndex = index;
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
[previewVc setDoneButtonClickBlockWithPreviewType:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) { [previewVc setDoneButtonClickBlockWithPreviewType:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
[weakSelf dismissViewControllerAnimated:YES completion:^{ __strong typeof(weakSelf) strongSelf = weakSelf;
if (weakSelf.didFinishPickingPhotosHandle) { [strongSelf dismissViewControllerAnimated:YES completion:^{
weakSelf.didFinishPickingPhotosHandle(photos,assets,isSelectOriginalPhoto); if (!strongSelf) return;
if (strongSelf.didFinishPickingPhotosHandle) {
strongSelf.didFinishPickingPhotosHandle(photos,assets,isSelectOriginalPhoto);
} }
}]; }];
}]; }];
...@@ -238,7 +240,8 @@ ...@@ -238,7 +240,8 @@
previewVc.currentIndex = 0; previewVc.currentIndex = 0;
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
[previewVc setDoneButtonClickBlockCropMode:^(UIImage *cropImage, id asset) { [previewVc setDoneButtonClickBlockCropMode:^(UIImage *cropImage, id asset) {
[weakSelf dismissViewControllerAnimated:YES completion:^{ __strong typeof(weakSelf) strongSelf = weakSelf;
[strongSelf dismissViewControllerAnimated:YES completion:^{
if (completion) { if (completion) {
completion(cropImage,asset); completion(cropImage,asset);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment