FROM : Andrew Farmer
DATE : Sun Apr 08 22:23:34 2007
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!
DATE : Sun Apr 08 22:23:34 2007
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!
| Related mails | Author | Date |
|---|---|---|
| Ken Tozier | Apr 8, 16:24 | |
| Ken Tozier | Apr 8, 16:48 | |
| glenn andreas | Apr 8, 17:01 | |
| Ken Tozier | Apr 8, 17:07 | |
| Andrew Farmer | Apr 8, 22:23 |






Cocoa mail archive

