Re: Leak in NSData +dataWithContentsOfURL:
Re: Leak in NSData +dataWithContentsOfURL:
- Subject: Re: Leak in NSData +dataWithContentsOfURL:
- From: Jonathan Feinberg <email@hidden>
- Date: Sat, 16 Mar 2002 00:08:45 -0500
This is all very interesting. However, I wonder if it's right
beyond a doubt. The problem is that NSURLHandle defines "caching"
behavior whereby URLHandles, and the data they have fetched, get
retained so that subsequent uses of the handle don't cause a refetch.
But if you (the user) are not explicitly retaining an
NSURLHandle--indeed, if you are explicitly releasing or autoreleasing
an NSData--then the library has no business retaining anything.
Furthermore, if you fetch the same URL more than one time via
dataWithContentsOfURL, you will clearly see the network being hit
each time. Furtherfurthermore, if there were some cache being
invoked, there would be no need to allocate still more memory each
time.
If you create an object and dispose of it properly, the memory should
go back to the heap.
N'est-ce pas?
--
Jonathan Feinberg email@hidden Inwood, NY, NY
http://MrFeinberg.com/
_______________________________________________
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.