• 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: I think I am leaking! :)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I think I am leaking! :)


  • Subject: Re: I think I am leaking! :)
  • From: Andrew Platzer <email@hidden>
  • Date: Sat, 27 Oct 2001 17:43:43 -0700

On Saturday, October 27, 2001, at 02:33 , Steven W. Riggins wrote:
I call this from windowDidLoad in my NSWindowController subclass.
When looking at my app with ObjectAlloc, I see 51 NSHTTPURLHandles. Looking in the instance browser tab, I see two events per instance, an AllocationEvent and an ObjectAutoreleasedEvent, but no release/dealloc.
This is boiled down from my larger issues, but trying to find out how I should be releasing the data from the NSURL has become an obsession :)
I'm surprised that you get an AllocationEvent and an ObjectAutoreleasedEvent but no subsequent actual release. It's as though the autorelease pool isn't being freed. This should happen each time you return from handling an event in NSApplication. I looked through the NSURL and NSHTTPURLHandle and didn't see any obvious leaks.
Thanks for the reply. I moved the entire test into a controller in the main nib. It only shows allocations now, no autoreleases, nothing.

In fact, there are *two* leaks. The aforementioned NSHTTPURLHandle and the NSData that it returns. The NSHTTPURLHandle because its dealloc routine neglects to call [super dealloc] and the NSData which is allocated but not autoreleased before being returned.

Thanks for finding them. I've filed bugs on both of them.

As for workarounds, the NSData leak isn't too bad though you should check version numbers since I'm sure we'll fix it for the next release. For the NSHTTPURLHandle, that's more difficult. If this is for an application that you want to ship, please contact me and we can figure something out. I have to talk to the owner of the code about these problems.

Andrew
__________________________________________________________________
A n d r e w P l a t z e r
A p p l i c a t i o n F r a m e w o r k s
A p p l e


  • Follow-Ups:
    • Re: I think I am leaking! :)
      • From: John Hörnkvist <email@hidden>
References: 
 >Re: I think I am leaking! :) (From: "Steven W. Riggins" <email@hidden>)

  • Prev by Date: Re: cocoa-dev digest, Vol 1 #773 - 17 msgs
  • Next by Date: Re: Widget Repository?
  • Previous by thread: Re: I think I am leaking! :)
  • Next by thread: Re: I think I am leaking! :)
  • Index(es):
    • Date
    • Thread