react-native/Libraries
Adam Comella 2aca021504 iOS: Fix dequeueTasks crash in image loader
Summary:
This fixes a crash occurring [on this line](f9f32eb426/Libraries/Image/RCTImageLoader.m (L253)). It was reported in a comment in #10433.

The problem is that `task` is deallocated at this point and is unsafe to use. Removing it from `_pendingTasks` dropped its ref count to 0. [The ARC docs](http://clang.llvm.org/docs/AutomaticReferenceCounting.html#fast-enumeration-iteration-variables) state that, by default, loop variables in fast enumeration loops are not retained. That's why `task`'s ref count is 0.

It's likely we ran into this bug because the code disobeyed the [reverseObjectEnumerator docs](https://developer.apple.com/reference/foundation/nsarray/1415734-reverseobjectenumerator) which state that "you must not modify the array during enumeration". The default retention policy for fast enumeration seems to assume you follow this.

To fix this bug and avoid other potential pitfalls, the code now follows the docs and `_pendingTa
Closes https://github.com/facebook/react-native/pull/11296

Differential Revision: D4277167

Pulled By: javache

fbshipit-source-id: 1211b32935bab7f4080dc00b88d85348786e859a
2016-12-05 10:13:29 -08:00
..
ART RN: Update React (2/2) 2016-11-04 05:43:44 -07:00
ActionSheetIOS Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
AdSupport Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
Alert fix typo in Alert.js 2016-10-14 08:13:55 -07:00
Animated Add more info link for warnedMissingNativeAnimated 2016-12-02 15:28:31 -08:00
AppState Remove deprecated APIs and modules 2016-10-11 07:43:52 -07:00
BatchedBridge Deploy v0.35.0 2016-11-14 20:45:17 -08:00
BugReporting RN: Update React (2/2) 2016-11-04 05:43:44 -07:00
CameraRoll Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
Components Fix iOS Picker Item Colors 2016-12-03 18:58:29 -08:00
Core Cannot assign to read only property 'product' of object '#<WorkerNavi… 2016-11-22 07:28:34 -08:00
CustomComponents Update type check for NavigationCardStack 2016-12-05 09:58:35 -08:00
DebugComponentHierarchy Move React Core Integration to a Dependency 2016-04-21 09:28:23 -07:00
EventEmitter RN: Cleanup OSS JS & Flow Declarations 2016-11-20 17:58:29 -08:00
Experimental enable variable size slideoutView with swipeableListView 2016-11-14 11:58:58 -08:00
Geolocation Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
Image iOS: Fix dequeueTasks crash in image loader 2016-12-05 10:13:29 -08:00
Inspector RN: Update React (2/2) 2016-11-04 05:43:44 -07:00
Interaction Add missing backtick in PanResponder.js docs 2016-12-02 15:13:34 -08:00
JSInspector Add Network agent 2016-11-02 12:29:15 -07:00
LayoutAnimation Mention that LayoutAnimation has to be explicitly enabled on A… 2016-11-25 15:28:28 -08:00
Linking Auto-fix lint errors 2016-08-09 06:43:46 -07:00
LinkingIOS Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
Modal make Modal pass rootTag to AppContainer 2016-11-18 01:43:26 -08:00
NativeAnimation Fix NativeAnimation invalidation & races on iOS 2016-11-28 11:13:31 -08:00
NavigationExperimental Fix animation in fast navigation between scenes 2016-11-23 09:58:42 -08:00
Network Deploy v0.36.0 2016-11-28 10:13:31 -08:00
Performance RN: Update React (2/2) 2016-11-04 05:43:44 -07:00
PermissionsAndroid Handle "Never Ask Again" in permissions and add requestMultiplePermissions 2016-11-24 22:43:28 -08:00
PushNotificationIOS Add missing closing brace in docs 2016-12-02 15:28:31 -08:00
RCTTest Fix imports in UIExplorerUnitTests 2016-11-24 09:58:31 -08:00
ReactNative Don't dismiss keyboard when tapping another text input 2016-11-25 05:43:30 -08:00
Renderer Add StyleSheet.setStyleAttributePreprocessor 2016-11-29 15:28:32 -08:00
Sample Update React Native minimum OS version to iOS8 2016-09-01 19:43:47 -07:00
Settings Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
Share Update Share.js. Fixed bad grammar 2016-11-23 11:28:29 -08:00
Storage Auto-fix lint errors 2016-08-09 06:43:46 -07:00
StyleSheet Add StyleSheet.setStyleAttributePreprocessor 2016-11-29 15:28:32 -08:00
Text Rename C api 2016-12-03 04:44:10 -08:00
Utilities Workaround native module dependency in Jest environment 2016-11-22 23:58:30 -08:00
Vibration Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
WebSocket Move all header imports to "<React/..>" 2016-11-23 07:58:39 -08:00
react-native RN: Cleanup OSS JS & Flow Declarations 2016-11-20 17:58:29 -08:00
vendor RN: Cleanup OSS JS & Flow Declarations 2016-11-20 17:58:29 -08:00
Promise.js Make onUnhandled safe for undefined errors 2016-08-02 07:58:28 -07:00
promiseRejectionIsError.js RN: Cleanup OSS JS & Flow Declarations 2016-11-20 17:58:29 -08:00