Re: Handle data disappearing out from underneath me
Re: Handle data disappearing out from underneath me
- Subject: Re: Handle data disappearing out from underneath me
- From: Andrew Farmer <email@hidden>
- Date: Sun, 8 Apr 2007 13:23:34 -0700
On 08 Apr 07, at 07:24, Ken Tozier wrote:
Being an autoreleased NSData probably has something to do with it
but I would have thought that PtrToHand did something internally to
prevent the deletion of the data it points to...
Nope. I'm pretty sure that, as part of the old Memory Manager,
PtrToHand doesn't do anything to retain data passed to it - it
assumes that the underlying data was allocated with NewPointer or
something similar. If the data was actually created as an NSData
instance and hasn't been retained, it will get deallocated and
(eventually) overwritten!
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden