Re: Memory Management issue?
Re: Memory Management issue?
- Subject: Re: Memory Management issue?
- From: Nick Zitzmann <email@hidden>
- Date: Sat, 24 Sep 2005 09:16:41 -0600
On Sep 24, 2005, at 9:06 AM, Aaron Wallis wrote:
// create a url for the file
NSURL * scriptURL = [[ NSURL alloc ] init];
Here you're wasting memory by creating a completely blank immutable URL.
scriptURL = [NSURL fileURLWithPath: [NSString
stringWithString:scriptPath]];
Here you're overwriting the pointer pointing to the blank URL with an
autoreleased URL that points to a file.
// release the path
[ scriptPath release ];
Here you're releasing the autoreleased URL you created earlier. This
will lead to a crash, since the autorelease pool will now try to
release something that has already been released.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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