Re: NSData being retained?
Re: NSData being retained?
- Subject: Re: NSData being retained?
- From: mmalcolm crawford <email@hidden>
- Date: Thu, 22 Jul 2004 11:26:15 -0700
On Jul 22, 2004, at 11:13 AM, Jim Ways wrote:
NSURL* aUrl = [NSURL URLWithString:urlString];
NSData *data = [aUrl resourceDataUsingCache:NO];
[aUrl release];
[aUrl release] is an error -- see the many references on memory
management.
This allocates memory but never releases it, if i
[data release]; i get a bus error.
To be expected -- again see memory management references.
If i set data to nil i still get an increase in memory each loop. The
contents of data dont seem to increase with each cycle but i cant
track down where the memory is comming
What's the context? You mention a loop -- are you simply iterating
over a set of URL strings? If this is the case, and you have not
created your own autorelease pool, then memory usage will increase
during the loop until you exit and release the release pool...
<
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/
Concepts/AutoreleasePools.html>
mmalc
_______________________________________________
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.