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: Julien Jalon <email@hidden>
- Date: Thu, 4 Apr 2002 23:04:38 +0200
Le jeudi 4 avril 2002, ` 09:19 , Chris Roberts a icrit :
After Reading around and lurking here and other places I found that the
Drag-N-Drop and Double-Click doc to launch was passed by the following
code but....
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];
^^^^^^^^^^^^^^^^^
very weird you release filename since you don't actually owns it (see doc
<
http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/
MemoryMgmt/Concepts/ObjectOwnership.html>), ie that you never
retained/alloc-inited/copied yourself.
[self LoadInfo:filename];
return YES;
}
_______________________________________________
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.
--
Julien Jalon
<
http://software.julien-jalon.org>
_______________________________________________
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.