Skip to content

Commit

Permalink
fix crash ios gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Sep 27, 2023
1 parent 23b636a commit fc6b3c0
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 fc6b3c0

@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.09.458911 just submitted!

Please sign in to comment.