STILL: HELP!!! Memory Leak I can't find in (BOOL)application:(NSApplication *)sender openFile:
STILL: HELP!!! Memory Leak I can't find in (BOOL)application:(NSApplication *)sender openFile:
- Subject: STILL: HELP!!! Memory Leak I can't find in (BOOL)application:(NSApplication *)sender openFile:
- From: Chris Roberts <email@hidden>
- Date: Thu, 4 Apr 2002 15:45:05 -0700
The code Now reads and the symptoms are the same????
- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename
{
[self LoadPackageInfo:filename];
return YES;
}
On Thursday, April 4, 2002, at 02:00 PM, Finlay Dobbie wrote:
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.
_______________________________________________
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.