On Mar 19, 2008, at 6:18 PM, Chris Suter wrote:
I think it's because

[NSMutableData dataWithBytesNoCopy:returnArray length:length]

is releasing returnArray and allocating a new buffer for it. I'm guessing that's because it's NSMutableData.

To fix it, use NSData instead.


Ding ding ding! I would have never guessed that -[NSMutableData dataWithBytesNoCopy:...] throws away the original bytes (odd behavior), and the NSData version doesn't (expected behavior), but now when I run the code, Guard Malloc no longer crashes.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to