• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: HELP!!! Memory Leak I can't find in (BOOL)application:(NSApplication *)sender openFile:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • STILL: HELP!!! Memory Leak I can't find in (BOOL)application:(NSApplication *)sender openFile:
      • From: Chris Roberts <email@hidden>
References: 
 >HELP!!! Memory Leak I can't find in (BOOL)application:(NSApplication *)sender openFile: (From: Chris Roberts <email@hidden>)

  • Prev by Date: OpenGL
  • Next by Date: Re: HELP!!! Memory Leak I can't find in (BOOL)application:(NSApplication *)sender openFile:
  • Previous by thread: HELP!!! Memory Leak I can't find in (BOOL)application:(NSApplication *)sender openFile:
  • Next by thread: STILL: HELP!!! Memory Leak I can't find in (BOOL)application:(NSApplication *)sender openFile:
  • Index(es):
    • Date
    • Thread