Re: Can't keep from leaking memory
Re: Can't keep from leaking memory
- Subject: Re: Can't keep from leaking memory
- From: Lee Morgan <email@hidden>
- Date: Sat, 25 Jun 2005 16:55:25 -0400
On Jun 25, 2005, at 4:32 PM, Ondra Cada wrote: if it is, it would be a bug in NSData.
I seriously doubt it though: matter of fact, initWithData would hardly ever return nil. Perhaps (I haven't tested!) if otherData is nil too, in which case you can test for it easily (and in which case you probably should not use initWithData: at all :))
I think the problem might be arising from otherData, and not someData. As it only happens when otherData is nil. Incidentally and to be frank, I did even not know there is an -[NSData initWithData] method; myself, in such a case, I would use copy. That would make sure nothing can leak (or fail otherwise) if otherData is nil :))
Well, sadly the leak happens no matter what form of alloc & init I use. Thats why I think it's otherData leaking instead of someData.
- Lee |
_______________________________________________
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