Re: cocoa-dev digest, Vol 1 #345 - 15 msgs
Re: cocoa-dev digest, Vol 1 #345 - 15 msgs
- Subject: Re: cocoa-dev digest, Vol 1 #345 - 15 msgs
- From: Rainer Brockerhoff <email@hidden>
- Date: Wed, 1 Aug 2001 21:09:12 -0300
>
From: Ondra Cada <email@hidden>
>
Date: Wed, 1 Aug 2001 13:59:06 +0200
>
>
BY> but will cause memory leaks if you've malloc'd something or
>
>
This it would, so you should never use explicit malloc -- always wrap it
>
into an object (which can be autoreleased).
Hmmm... excuse me, but I can't quite understand why.
If I need a 1 or 2K buffer for a couple of lines to get some result from a Carbon call, why shouldn't I malloc it before the call, copy the buffer's contents to some object, and then free it again?
How would this "wrapping into an object" look like? And then I'd have to get a C pointer to its contents, anyway...
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
In their own business even sages err."
http://www.brockerhoff.net/ (updated July 2000)