TimOliver / TOCropViewController

A view controller for iOS that allows users to crop portions of UIImage objects
http://www.timoliver.com.au/2015/06/21/tocropviewcontroller-an-open-source-image-cropper-for-ios/
MIT License
4.73k stars 952 forks source link

Crash when double tap done button #416

Open Amefuri opened 4 years ago

Amefuri commented 4 years ago

Describe the bug Application crash when we done cropping and repeat tap done button before library done the cropping process.

To Reproduce Steps to reproduce the behavior:

  1. Show TOCropViewController
  2. Process edit picture / cropping
  3. Quickly repeat tap done button in the bottom right
  4. See error:
cropViewController:didCropToImage
CropViewController was compiled with optimization - stepping may behave oddly; variables may not be available.

https://i.ibb.co/nCxkVvJ/Screen-Shot-2563-06-08-at-14-02-15.png

Expected behavior Library done the cropping process and return the cropped image.

iOS Device:

TimOliver commented 4 years ago

Hi @Amefuri! Thanks for reporting this bug!

Hmm, that's interesting. I wonder if that dispatch delay is causing an issue. Maybe if you can, try commenting out the dispatch_after line (And the subsequent }); one too) and see if that fixes it!

I'll try and look at it when I get the chance, but if you can try diagnosing the problem for your own use case, that would help a lot. :)

Thanks!