Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timob 6229 Dashboard memory leak cleanup #810

Merged
merged 4 commits into from Dec 3, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions iphone/Classes/LauncherButton.m
Expand Up @@ -55,6 +55,7 @@ -(void)dealloc
[button release];
[closeButton release];
[badge release];
[item release];
item = nil;
[super dealloc];
}
Expand Down
2 changes: 1 addition & 1 deletion iphone/Classes/LauncherItem.h
Expand Up @@ -51,7 +51,7 @@
@property(nonatomic,assign) LauncherButton *button;


@property(nonatomic,readwrite,retain) id userData;
@property(nonatomic,readwrite,assign) id userData;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value is released in dealloc, and could lead to double-frees. This should be a retained value.



@property(nonatomic) BOOL canDelete;
Expand Down
1 change: 0 additions & 1 deletion iphone/Classes/LauncherItem.m
Expand Up @@ -54,7 +54,6 @@ -(void)dealloc
[title release];
[image release];
[selectedImage release];
[userData release];
[view release];
[super dealloc];
}
Expand Down
10 changes: 10 additions & 0 deletions iphone/Classes/TiUIDashboardItemProxy.m
Expand Up @@ -15,15 +15,25 @@ @implementation TiUIDashboardItemProxy

-(void)_destroy
{
item.userData = nil;
item.view = nil;
RELEASE_TO_NIL(item);
[super _destroy];
}

-(void)dealloc{
item.userData = nil;
item.view = nil;
RELEASE_TO_NIL(item);
[super dealloc];
}

-(void)setItem:(LauncherItem*)item_
{
if (item!=nil)
{
item.userData = nil;
item.view = nil;
RELEASE_TO_NIL(item);
}
item = [item_ retain];
Expand Down