Re: HELP!!! Memory Leak I can't find in (BOOL)application:(NSApplication *)sender openFile:
Re: HELP!!! Memory Leak I can't find in (BOOL)application:(NSApplication *)sender openFile:
- Subject: Re: HELP!!! Memory Leak I can't find in (BOOL)application:(NSApplication *)sender openFile:
- From: Finlay Dobbie <email@hidden>
- Date: Thu, 4 Apr 2002 22:00:06 +0100
On Thursday, April 4, 2002, at 08:19 PM, Chris Roberts wrote:
When I use this code using a Drag-N-drop or launch from doc my Method
LoadInfo:(NSString *)filename runs then the app exits with a sig
11(crash) my method works great from a NSOpen but... My guess is I
have not created a release that I should have but where and what HELP!
- (BOOL)application:(NSApplication *)sender openFile:(NSString
*)filename
{
[filename autorelease];
[self LoadInfo:filename];
return YES;
}
Memory leaks do not crash your application. Actually, what you are doing
is releasing something you shouldn't: since you didn't alloc or copy
filename, you can assume it is autoreleased. So you have an extra
release: you manually autorelease filename. This is what is causing your
crash.
-- Finlay
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.