Minor memory-logic error. textField is a retain property, so assigning to it retains it, and assigning NULL to it releases it. Also, an init method called release outside the proper scope (the do{}while(0); block).

If you don't like the autorelease pool, it's easy enough to change this fix.

Aside: someone pulled tools/cxx-generator again, not me(!) :-)
This commit is contained in:
Donald Alan Morrison 2012-09-24 14:55:40 -07:00
parent 8937a3f9cc
commit 8693c54997
2 changed files with 3 additions and 6 deletions

View File

@ -51,7 +51,7 @@
{ {
[textField_ resignFirstResponder]; [textField_ resignFirstResponder];
[textField_ removeFromSuperview]; [textField_ removeFromSuperview];
[textField_ release]; self.textField = NULL;
[super dealloc]; [super dealloc];
} }
@ -63,7 +63,7 @@
{ {
if (self == nil) break; if (self == nil) break;
editState_ = NO; editState_ = NO;
textField_ = [[CustomUITextField alloc] initWithFrame: frameRect]; textField_ = [[[CustomUITextField alloc] initWithFrame: frameRect] autorelease];
if (!textField_) break; if (!textField_) break;
[textField_ setTextColor:[UIColor whiteColor]]; [textField_ setTextColor:[UIColor whiteColor]];
textField_.font = [UIFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here. textField_.font = [UIFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here.
@ -79,9 +79,6 @@
return self; return self;
}while(0); }while(0);
[textField_ release];
return nil; return nil;
} }

@ -1 +1 @@
Subproject commit 40ad79373b6c041a3312afb36da6985b91f0a3dc Subproject commit 5154f8898bb8755bda496a84fa39abe97d6a9b44