• 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
Leak in Apple's /Examples/SimpleStickies3_Final/EntityModel.m
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Prev by Date: NSTextField background
  • Next by Date: A puzzlement - A Cocoa Audio application
  • Previous by thread: Re: NSTextField background
  • Next by thread: A puzzlement - A Cocoa Audio application
  • Index(es):
    • Date
    • Thread