Skip to content

Commit

Permalink
Merge pull request #2506 from mstepanov/timob-9826
Browse files Browse the repository at this point in the history
[TIMOB-9826] iOS fix memory leaks
  • Loading branch information
srahim committed Jul 9, 2012
2 parents 6793f9d + f17d2c0 commit 04c44ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions iphone/Classes/TiApp.mm
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ -(void)attachXHRBridgeIfRequired
- (void) loadUserDefaults
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSDictionary *appDefaults = [[NSDictionary alloc] initWithDictionary:[ApplicationDefaults copyDefaults]];
if(appDefaults)
NSDictionary *appDefaults = [ApplicationDefaults copyDefaults];
if(appDefaults != nil)
{
[defaults registerDefaults:appDefaults];
}
Expand Down
3 changes: 3 additions & 0 deletions iphone/Classes/TiProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,9 @@ - (id) valueForUndefinedKey: (NSString *) key

- (void)replaceValue:(id)value forKey:(NSString*)key notification:(BOOL)notify
{
if (destroyed) {
return;
}
if([value isKindOfClass:[KrollCallback class]]){
[self setCallback:value forKey:key];
//As a wrapper, we hold onto a KrollWrapper tuple so that other contexts
Expand Down
3 changes: 2 additions & 1 deletion support/iphone/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@ def copy_tiapp_properties(project_dir):
if (len(tiapp.findall("property")) > 0) :
impf.write("\n return _property;\n}")
else:
impf.write("\n return NULL;\n}")
impf.write("\n [_property release];")
impf.write("\n return nil;\n}")
impf.write(FOOTER)
impf.close()
if open(appl_default,'r').read() == open('ApplicationDefaults.m','r').read():
Expand Down

0 comments on commit 04c44ce

Please sign in to comment.