Leak in Apple's /Examples/SimpleStickies3_Final/EntityModel.m
Leak in Apple's /Examples/SimpleStickies3_Final/EntityModel.m
- Subject: Leak in Apple's /Examples/SimpleStickies3_Final/EntityModel.m
- From: Erik Buck <email@hidden>
- Date: Sun, 29 Jan 2006 21:20:42 -0500
I believe the following code from Apple's SimpleStickies3_Final/
EntityModel.m example contains a memory leak:
// Returns a file wrapper representation of the receiver, where the
receiver and
// each entity has its own plist file in the directory.
- (NSFileWrapper *)fileWrapperRepresentation
{
NSFileWrapper *directoryWrapper = [[NSFileWrapper alloc]
initDirectoryWithFileWrappers:nil];
[...stuff deleted for brevity...]
return directoryWrapper;
}
I think this leaks directoryWrapper.
This line
NSFileWrapper *directoryWrapper = [[NSFileWrapper alloc]
initDirectoryWithFileWrappers:nil];
should be
NSFileWrapper *directoryWrapper = [[[NSFileWrapper alloc]
initDirectoryWithFileWrappers:nil] autorelease];
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden