Permalink
Browse files

fix memory leak

  • Loading branch information...
1 parent 835e499 commit dfd7e39f70a03e836871a2767a46aa6d555b2f5f @siuying siuying committed Jul 12, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 MMGridView/MMGridViewDefaultCell.m
@@ -41,15 +41,15 @@ - (id)initWithFrame:(CGRect)frame
{
if ((self = [super initWithFrame:frame])) {
// Background view
- self.backgroundView = [[UIView alloc] initWithFrame:CGRectNull];
+ self.backgroundView = [[[UIView alloc] initWithFrame:CGRectNull] autorelease];
self.backgroundView.backgroundColor = [UIColor lightGrayColor];
[self addSubview:self.backgroundView];
// Label
- self.textLabelBackgroundView = [[UIView alloc] initWithFrame:CGRectNull];
+ self.textLabelBackgroundView = [[[UIView alloc] initWithFrame:CGRectNull] autorelease];
self.textLabelBackgroundView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.7];
- self.textLabel = [[UILabel alloc] initWithFrame:CGRectNull];
+ self.textLabel = [[[UILabel alloc] initWithFrame:CGRectNull] autorelease];
self.textLabel.textAlignment = UITextAlignmentRight;
self.textLabel.backgroundColor = [UIColor clearColor];
self.textLabel.textColor = [UIColor whiteColor];

0 comments on commit dfd7e39

Please sign in to comment.