jamesmontemagno / Xamarin.Plugins

Cross-platform Native API Access from Shared Code!
MIT License
1.3k stars 380 forks source link

Update MediaPickerDelegate.cs #220

Closed DVrsajko closed 8 years ago

DVrsajko commented 8 years ago

Fix for orientation change issue, EXC_BAD_ACCESS (SIGABRT), during Dismiss on iOS. Did not change the Andorid or WPhone files, because i cannot test them, and do not know if the bug exists there.

The problem was that the plugin did not stop listening for orientation notifications on time, so the user could trigger the notification to be sent to the view, but in the time it came, picker dispose already executed. This change handles the removal of notifications and observer dispose first thing after clicking "Cancel" or "Use Picture".

jamesmontemagno commented 8 years ago

This only happens when you rotate the device. Looks like previously it only did it for iPad..

DVrsajko commented 8 years ago

Yes iPad after rotate. That is my testing device. The users are all using iPad's and iPhone's so I automatically figured that it is on all devices. They did not specify. Cannot confirm that it is happening on a mobile device.

DVrsajko commented 8 years ago

I just realized that my fix is not good. Sorry I should've got more familiar with the code. I do not have the view controller check.

Edited: Added the check in a new method

DVrsajko commented 8 years ago

Thanks.

Cheers!