Crash after [NSData dataWithData:(NSMutableData *)]
Crash after [NSData dataWithData:(NSMutableData *)]
- Subject: Crash after [NSData dataWithData:(NSMutableData *)]
- From: email@hidden
- Date: Tue, 26 Jul 2005 06:35:17 -0700
Omitting a great deal of intervening code for brevity, my program is
doing this:
NSMutableData * sourceData = [NSMutableData dataWithCapacity:
[theAnnotatedData length]];
// append some bytes to sourceData
NSData * destinationData = [NSData dataWithData:aData];
[sourceData release];
destinationData is actually a member of another class, and the NSData
dataWithData: line in in that class.
The program crashes with EXC_BAD_ACCESS in NSPopAutoreleasePool/
objc_msgSend_rtp if I release sourceData. If I comment out the last
line, no crash.
There is plenty of other stuff I could be doing wrong (e.g., being a
hopeless noob), but as a sanity check, am I supposed to be retaining
something or not using NSData dataWithData: from an instance of
NSMutableData?
Thanks.
_______________________________________________
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