From bca73e6ee95c005dea59f6f05ff0b3f50917de33 Mon Sep 17 00:00:00 2001 From: Murat Sutunc Date: Tue, 3 Mar 2015 13:11:01 -0800 Subject: [PATCH] CB-8599 fix threading issue with cameraPicker (fixes #72) Signed-off-by: Shazron Abdullah --- src/ios/CDVCamera.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m index 37bc716..e5ba1ee 100644 --- a/src/ios/CDVCamera.m +++ b/src/ios/CDVCamera.m @@ -167,9 +167,11 @@ static NSString* toBase64(NSData* data) { weakSelf.hasPendingOperation = NO; } else { - [weakSelf.viewController presentViewController:cameraPicker animated:YES completion:^{ - weakSelf.hasPendingOperation = NO; - }]; + dispatch_async(dispatch_get_main_queue(), ^{ + [weakSelf.viewController presentViewController:cameraPicker animated:YES completion:^{ + weakSelf.hasPendingOperation = NO; + }]; + }); } }]; }