Fixed layout animation crash

This commit is contained in:
Nick Lockwood 2015-09-04 05:26:09 -07:00
parent e4110456ab
commit bb5522582d
1 changed files with 5 additions and 0 deletions

View File

@ -488,6 +488,11 @@ extern NSString *RCTBridgeModuleNameForClass(Class cls);
// Perform layout (possibly animated)
return ^(__unused RCTUIManager *uiManager, RCTSparseArray *viewRegistry) {
RCTResponseSenderBlock callback = self->_layoutAnimation.callback;
// It's unsafe to call this callback more than once, so we nil it out here
// to make sure that doesn't happen.
_layoutAnimation.callback = nil;
__block NSUInteger completionsCalled = 0;
for (NSUInteger ii = 0; ii < frames.count; ii++) {
NSNumber *reactTag = frameReactTags[ii];