Skip to content

Commit

Permalink
Styled Text Field - Really fixed crash/leak issue this time (thanks T…
Browse files Browse the repository at this point in the history
…revor Squires and Mike Ash)
  • Loading branch information
Brandon Walkin committed Oct 3, 2009
1 parent 685e269 commit d910da2
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions BWStyledTextFieldCell.m
Expand Up @@ -70,15 +70,25 @@ - (void)encodeWithCoder:(NSCoder *)coder
[coder encodeObject:[self solidColor] forKey:@"BWSTFCSolidColor"];
}

- (id)copyWithZone:(NSZone *)zone
{
BWStyledTextFieldCell *cell = (BWStyledTextFieldCell *)[super copyWithZone:zone];

if (cell)
{
cell->previousAttributes = [previousAttributes mutableCopy];
cell->shadow = [shadow retain];
cell->shadowColor = [shadowColor retain];
cell->startingColor = [startingColor retain];
cell->endingColor = [endingColor retain];
cell->solidColor = [solidColor retain];
}

return cell;
}

- (void)dealloc
{
shadow = nil;
previousAttributes = nil;
solidColor = nil;
endingColor = nil;
startingColor = nil;
shadowColor = nil;

[shadow release];
[previousAttributes release];
[solidColor release];
Expand Down

0 comments on commit d910da2

Please sign in to comment.