Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix crash ios gallery #2810

Merged
merged 1 commit into from Oct 4, 2023
Merged

fix crash ios gallery #2810

merged 1 commit into from Oct 4, 2023

Conversation

PeterPetrik
Copy link
Contributor

fix #1540
fix CU-862keccax

it looks like if the user is really quick he can select another photo in the gallery when the first one is being processed in imagePickerControllerDidFinishPickingMediaWithInfo and unfortunately I do not see a way to hide that dialog fast enough. The view delegate is not reused between 2 select/capture actions so I added BOOL to block the second (another) selection while the first one is being proceeded.

@iiLubos iiLubos self-requested a review October 3, 2023 12:25
@@ -210,7 +210,12 @@ +( void )showImagePicker:( int )sourceType : ( IOSImagePicker * )handler
// Confirm event
delegate->imagePickerControllerDidFinishPickingMediaWithInfo = ^( UIImagePickerController * picker, NSDictionary * info )
{
Q_UNUSED( picker )
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you remove this row?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is used on line 223, so it is not unused

Q_UNUSED( picker )
if ( delegate->processingPicture )
{
qWarning() << "Image Picker: Already processing other photo (imagePickerControllerDidFinishPickingMediaWithInfo)";
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to use CoreUtils::log, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not an error that user or support would need to be notified about - if user selects 2 images in quick succession, only one is taken and other one is discarded .

@iiLubos iiLubos self-requested a review October 3, 2023 12:46
Copy link
Contributor

@iiLubos iiLubos left a comment

Choose a reason for hiding this comment

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

Approved

@PeterPetrik PeterPetrik added the ready-for-testing Ready to be tested by testers crew - passed review by devs label Oct 4, 2023
@PeterPetrik PeterPetrik merged commit 897285b into master Oct 4, 2023
10 checks passed
@PeterPetrik PeterPetrik deleted the fix_ios_camera_crash branch October 4, 2023 08:20
@jozef-budac
Copy link

Verified on 2.4.0 RC (iOS: 2.4.0 (23.10.471911))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing Ready to be tested by testers crew - passed review by devs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when getting picture from gallery
4 participants