Retain cropData object in ImageEditingManager.cropImage
Retain cropData object in ImageEditingManager.cropImage

Summary:
All struct args are passed into NativeModule methods via references. If blocks access those references, we don't move those references to the heap. This means that by the time that the block accesses the struct arg, it could be freed. This can crash the program.

The solution is simple: we copy the struct arg, and access the copy in the block. This ensures that the block will make a copy, which prevents the underlying data structures from being released by the time that the block accesses the struct arg.

Changelog:
[iOS][Fixed] - Retain cropData struct arg in ImageEditingManager.cropImage call

Differential Revision: D18076026

fbshipit-source-id: 1a7bb602606ff1afac38ad5451662c82fa86f205

pandiaraj44/react-native,pandiaraj44/react-native,myntra/react-native,hammerandchisel/react-native,exponent/react-native,javache/react-native,pandiaraj44/react-native,javache/react-native,hammerandchisel/react-native,myntra/react-native,pandiaraj44/react-native,hammerandchisel/react-native,arthuralee/react-native,exponentjs/react-native,arthuralee/react-native,exponentjs/react-native,myntra/react-native,exponent/react-native,javache/react-native,arthuralee/react-native,hoangpham95/react-native,hammerandchisel/react-native,facebook/react-native,exponent/react-native,pandiaraj44/react-native,janicduplessis/react-native,javache/react-native,exponent/react-native,hoangpham95/react-native,facebook/react-native,hammerandchisel/react-native,hoangpham95/react-native,facebook/react-native,exponent/react-native,exponent/react-native,janicduplessis/react-native,myntra/react-native,javache/react-native,hoangpham95/react-native,javache/react-native,exponentjs/react-native,hoangpham95/react-native,pandiaraj44/react-native,myntra/react-native,javache/react-native,exponent/react-native,janicduplessis/react-native,javache/react-native,exponentjs/react-native,hammerandchisel/react-native,pandiaraj44/react-native,hoangpham95/react-native,facebook/react-native,myntra/react-native,facebook/react-native,facebook/react-native,facebook/react-native,janicduplessis/react-native,facebook/react-native,hammerandchisel/react-native,exponentjs/react-native,hoangpham95/react-native,janicduplessis/react-native,hammerandchisel/react-native,myntra/react-native,janicduplessis/react-native,facebook/react-native,exponentjs/react-native,arthuralee/react-native,javache/react-native,pandiaraj44/react-native,janicduplessis/react-native,exponentjs/react-native,exponent/react-native,janicduplessis/react-native,arthuralee/react-native,myntra/react-native,hoangpham95/react-native,exponentjs/react-native,myntra/react-native