Skip to content

Commit

Permalink
Merge pull request #2810 from MerginMaps/fix_ios_camera_crash
Browse files Browse the repository at this point in the history
fix crash ios gallery
  • Loading branch information
PeterPetrik authored Oct 4, 2023
2 parents 91519b9 + fc6b3c0 commit 897285b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/ios/iosinterface.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -244,7 +249,6 @@ +( void )showImagePicker:( int )sourceType : ( IOSImagePicker * )handler
Q_ARG( bool, err.isEmpty() ),
Q_ARG( const QVariantMap, data ) );
}
delegate = nil;
};


Expand Down
1 change: 1 addition & 0 deletions app/ios/iosviewdelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ UINavigationControllerDelegate>
@public

IOSImagePicker *handler;
BOOL processingPicture;

void ( ^ imagePickerControllerDidFinishPickingMediaWithInfo )( UIImagePickerController * picker, NSDictionary * info );
void ( ^ imagePickerControllerDidCancel )( UIImagePickerController * picker );
Expand Down
1 change: 1 addition & 0 deletions app/ios/iosviewdelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ -( id ) initWithHandler:( IOSImagePicker * )handler
self = [super init];
if ( self )
{
self->processingPicture = NO;
self->handler = handler;
}
return self;
Expand Down

1 comment on commit 897285b

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 23.10.462711 just submitted!

Please sign in to comment.