diff --git a/app/ios/iosinterface.mm b/app/ios/iosinterface.mm index d3efa99b3..7a8e3cbf1 100644 --- a/app/ios/iosinterface.mm +++ b/app/ios/iosinterface.mm @@ -210,7 +210,12 @@ +( void )showImagePicker:( int )sourceType : ( IOSImagePicker * )handler // Confirm event delegate->imagePickerControllerDidFinishPickingMediaWithInfo = ^( UIImagePickerController * picker, NSDictionary * info ) { - Q_UNUSED( picker ) + if ( delegate->processingPicture ) + { + qWarning() << "Image Picker: Already processing other photo (imagePickerControllerDidFinishPickingMediaWithInfo)"; + return; + } + delegate->processingPicture = YES; NSString *imagePath = generateImagePath( delegate->handler->targetDir().toNSString() ); QString err; @@ -244,7 +249,6 @@ +( void )showImagePicker:( int )sourceType : ( IOSImagePicker * )handler Q_ARG( bool, err.isEmpty() ), Q_ARG( const QVariantMap, data ) ); } - delegate = nil; }; diff --git a/app/ios/iosviewdelegate.h b/app/ios/iosviewdelegate.h index 6a4efa05e..92e5c4d21 100644 --- a/app/ios/iosviewdelegate.h +++ b/app/ios/iosviewdelegate.h @@ -28,6 +28,7 @@ UINavigationControllerDelegate> @public IOSImagePicker *handler; + BOOL processingPicture; void ( ^ imagePickerControllerDidFinishPickingMediaWithInfo )( UIImagePickerController * picker, NSDictionary * info ); void ( ^ imagePickerControllerDidCancel )( UIImagePickerController * picker ); diff --git a/app/ios/iosviewdelegate.mm b/app/ios/iosviewdelegate.mm index 3ece81df0..df43b62f6 100644 --- a/app/ios/iosviewdelegate.mm +++ b/app/ios/iosviewdelegate.mm @@ -27,6 +27,7 @@ -( id ) initWithHandler:( IOSImagePicker * )handler self = [super init]; if ( self ) { + self->processingPicture = NO; self->handler = handler; } return self;