mirror of
https://github.com/nickshanks/ResKnife.git
synced 2024-06-01 02:41:30 +00:00
Fix uninitialized values and leaks.
This commit is contained in:
parent
abbced3d0d
commit
609d3fda54
|
@ -65,7 +65,7 @@
|
|||
#endif
|
||||
+ (NSCharacterSet *)tabCharacterSet
|
||||
{
|
||||
unsigned char bitmapRep[8192];
|
||||
unsigned char bitmapRep[8192] = { 0 };
|
||||
bitmapRep[0x09 >> 3] |= (((unsigned int)1) << (0x09 & 7));
|
||||
bitmapRep[0x0B >> 3] |= (((unsigned int)1) << (0x0B & 7));
|
||||
NSData *data = [NSData dataWithBytesNoCopy:bitmapRep length:8192 freeWhenDone:YES];
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
- (NSAttributedString *)attributedStringForObjectValue:(id)obj withDefaultAttributes:(NSDictionary *)attrs
|
||||
{
|
||||
NSString *string = [self stringForObjectValue:obj];
|
||||
return [[NSAttributedString alloc] initWithString:string attributes:attrs];
|
||||
return [[[NSAttributedString alloc] initWithString:string attributes:attrs] autorelease];
|
||||
}
|
||||
|
||||
- (NSString *)editingStringForObjectValue:(id)obj
|
||||
|
|
|
@ -154,7 +154,7 @@ NSString *RKResourcePboardType = @"RKResourcePboardType";
|
|||
|
||||
- (id)copyWithZone:(NSZone *)zone
|
||||
{
|
||||
Resource *copy = [[Resource alloc] initWithType:type andID:resID withName:name andAttributes:attributes data:[data copy]];
|
||||
Resource *copy = [[Resource alloc] initWithType:type andID:resID withName:name andAttributes:attributes data:[[data copy] autorelease]];
|
||||
[copy setDocumentName:_docName];
|
||||
return copy;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user