gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: big memory leak in GSString


From: David Chisnall
Subject: Re: big memory leak in GSString
Date: Tue, 8 Jan 2013 14:51:07 +0000

On 8 Jan 2013, at 14:41, Pirmin Braun wrote:

>        NSString *s1 = [[a oai:i]copy];

For an immutable string, -copy just calls retain.  If you want to actually copy 
the string, do something like:

NSString *s1 = [NSString stringWithUTF8String: [old UTF8String]];

(for better performance, you might want to use getCharacters:range: and a 
temporary buffer, so that the old string doesn't have to create a new 
autoreleased buffer).

David

-- Sent from my STANTEC-ZEBRA




reply via email to

[Prev in Thread] Current Thread [Next in Thread]