mirror of
https://github.com/nickshanks/ResKnife.git
synced 2024-06-14 09:29:28 +00:00
-autorelease goes *after* -init
This commit is contained in:
parent
c702faaaf2
commit
76281dd506
|
@ -4,7 +4,7 @@
|
|||
|
||||
+ (id)elementForType:(NSString *)t withLabel:(NSString *)l
|
||||
{
|
||||
return [[[self alloc] autorelease] initForType:t withLabel:l];
|
||||
return [[[self alloc]initForType:t withLabel:l] autorelease];
|
||||
}
|
||||
|
||||
- (id)initForType:(NSString *)t withLabel:(NSString *)l
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
|
||||
+ (id)streamWithBytes:(char *)d length:(unsigned int)l
|
||||
{
|
||||
return [[[self alloc] autorelease] initStreamWithBytes:d length:l];
|
||||
return [[[self alloc] initStreamWithBytes:d length:l] autorelease];
|
||||
}
|
||||
|
||||
+ (id)substreamWithStream:(TemplateStream *)s length:(unsigned int)l
|
||||
{
|
||||
return [[[self alloc] autorelease] initWithStream:s length:l];
|
||||
return [[[self alloc] initWithStream:s length:l] autorelease];
|
||||
}
|
||||
|
||||
- (id)initStreamWithBytes:(char *)d length:(unsigned int)l
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
{
|
||||
if(!liveEdit)
|
||||
// bug: should display alert asking if you want to replace data in this editor or reassert this data, revoking the other editor's changes
|
||||
[resource setData:[[backup data] copy]];
|
||||
[resource setData:[[[backup data] copy] autorelease]];
|
||||
[self loadResource];
|
||||
}
|
||||
|
||||
|
@ -204,14 +204,14 @@
|
|||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:ResourceDataDidChangeNotification object:resource];
|
||||
[resource setData:newData];
|
||||
[backup setData:[newData copy]];
|
||||
[backup setData:[[newData copy] autorelease]];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resourceDataDidChange:) name:ResourceDataDidChangeNotification object:resource];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:ResourceDataDidChangeNotification object:backup];
|
||||
[resource setData:newData];
|
||||
[backup setData:[newData copy]];
|
||||
[backup setData:[[newData copy] autorelease]];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(resourceDataDidChange:) name:ResourceDataDidChangeNotification object:backup];
|
||||
[self setDocumentEdited:NO];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user