Skip to content

Commit

Permalink
Merge pull request #6654 from pec1985/TIMOB-17367
Browse files Browse the repository at this point in the history
[TIMOB-17367] iOS - avoid left and right nav buttons on window to get GC'ed
  • Loading branch information
vishalduggal committed Feb 20, 2015
2 parents 1bae1a7 + 180926c commit b7b6215
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions iphone/Classes/TiUIWindowProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,15 @@ -(void)setRightNavButtons:(id)arg withObject:(id)properties
for (TiViewProxy* curProxy in curValues) {
if (![(NSArray*)arg containsObject:curProxy]) {
[curProxy removeBarButtonView];
[self forgetProxy:curProxy];
}
}

for(TiViewProxy* proxy in arg) {
if([proxy isKindOfClass:[TiViewProxy class]]) {
[self rememberProxy:proxy];
}
}

[self replaceValue:arg forKey:@"rightNavButtons" notification:NO];
[self replaceValue:properties forKey:@"rightNavSettings" notification:NO];
TiThreadPerformOnMainThread(^{
Expand Down Expand Up @@ -600,9 +606,14 @@ -(void)setLeftNavButtons:(id)arg withObject:(id)properties
for (TiViewProxy* curProxy in curValues) {
if (![(NSArray*)arg containsObject:curProxy]) {
[curProxy removeBarButtonView];
[self forgetProxy:curProxy];
}
}
for(TiViewProxy* proxy in arg) {
if([proxy isKindOfClass:[TiViewProxy class]]) {
[self rememberProxy:proxy];
}
}

[self replaceValue:arg forKey:@"leftNavButtons" notification:NO];
[self replaceValue:properties forKey:@"leftNavSettings" notification:NO];
TiThreadPerformOnMainThread(^{
Expand Down

0 comments on commit b7b6215

Please sign in to comment.