Skip to content

Commit

Permalink
Merge pull request #8920 from hansemannn/TIMOB-18301
Browse files Browse the repository at this point in the history
[TIMOB-18301] iOS: Fix linearVelocityForItem crash
  • Loading branch information
hansemannn committed May 24, 2017
2 parents 42c1b5a + 93da98f commit 0255137
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions iphone/Classes/TiDynamicItemBehavior.m
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,12 @@ -(NSDictionary*)linearVelocityForItem:(id)args
NSUInteger theIndex = [_items indexOfObject:args];
__block TiPoint* returnVal = nil;
TiThreadPerformOnMainThread(^{
returnVal = [[_linearVelocities objectAtIndex:theIndex] copy];
returnVal = [[_linearVelocities objectAtIndex:theIndex] retain];
}, YES);

NSDictionary* result = [TiUtils pointToDictionary:[returnVal point]];
[returnVal release];
RELEASE_TO_NIL(returnVal);

return result;
} else {
DebugLog(@"[ERROR] The item specified is not an item managed by this behavior object");
Expand All @@ -340,4 +341,4 @@ -(NSDictionary*)linearVelocityForItem:(id)args

@end
#endif
#endif
#endif

0 comments on commit 0255137

Please sign in to comment.