> On 16 Mar 2018, at 15:18, amon <a...@vnl.com> wrote:
> 
> 
>            [arglist release];
>  arglist = [[[NSMutableString stringWithCString: [cmdline cString]]
>               componentsSeparatedByString: DELIM] retain];
> 
> This happens inside an init. arglist is release by the dealloc
> method. However, NSMutableString insists on making it autoreleased.
> I want to make it not do that. 

Portable GNUstep code would look like this:

CREATE_AUTORELEASE_POOL(pool);
ASSIGN(arglist, [[[NSMutableString stringWithCString: [cmdline cString]] 
componentsSeparatedByString: DELIM]);
DESTROY(pool);

with no wasted/leaked memory.


_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to