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: Richard Frith-Macdonald
Subject: Re: big memory leak in GSString
Date: Tue, 8 Jan 2013 09:21:49 +0000

On 8 Jan 2013, at 00:28, Pirmin Braun wrote:

> the substrings of a substring retain their string from which they where 
> splitted off;
> when those 2nd generation substrings are retained, the 1st generation 
> substrings won't get deallocated;
> but they should, they are just intermediate objects;

Yes ... I see what you mean.

It's certainly not a leak and not a bug:  clearly you can work around ... 
decrease memory usage ... by copying the substrings and then emptying the 
autorelease pool that contains all the substrings, so that they get released 
earlier rather than later.
However, the fact that the Apple behavior allows intermediate strings to be 
released earlier in some circumstances is a good thing (with no downside that I 
can see).
So I modified the code in svn trunk to match the Apple behavior.


reply via email to

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