Skip to content

Commit

Permalink
[TIMOB-8295] Ensure Ti.UI.View.children is a copy, not a live reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
sptramer committed Apr 28, 2012
1 parent fb1ee99 commit a19c905
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions iphone/Classes/TiViewProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,18 @@ -(void)setVzIndex:(int)newZindex
@synthesize children;
-(NSArray*)children
{
NSArray* copy = nil;

pthread_rwlock_rdlock(&childrenLock);
if (windowOpened==NO && children==nil && pendingAdds!=nil)
{
NSArray *copy = [pendingAdds mutableCopy];
pthread_rwlock_unlock(&childrenLock);
return [copy autorelease];
copy = [pendingAdds mutableCopy];
}
else {
copy = [children mutableCopy];
}
pthread_rwlock_unlock(&childrenLock);
return children;
return [copy autorelease];
}

-(void)setVisible:(NSNumber *)newVisible withObject:(id)args
Expand Down

0 comments on commit a19c905

Please sign in to comment.