Hi,

I was running valgrind with the —leak-check=yes option which gives a very 
detailed output of memcheck.
Without that option, the probable memory leaks don’t appear any more.
I will make a simple test program, to test this, using the option set to yes 
and post it here.

Thanks,
Regards

Daniel Santos



> On 16 Jan 2025, at 14:08, richard <[email protected]> wrote:
> 
> You shouldn't have to do anything (apart from copy the string if you want to 
> keep it) ... if it's leaking it sounds like a bug, because the memory should 
> be freed when your current autorelease pool is exited.
> If you are doing this outside any autorelease pool (which you should never 
> do), you should have seen a warning printed about it, so that's unlikely to 
> be the issue.
> 
> Please can you supply a tiny test program demonstrating the issue.
> 
> 
>> On 16 Jan 2025 at 12:57, Daniel Santos <[email protected] 
>> <mailto:[email protected]>> wrote: 
>> 
>> Hello Community,
>> 
>> I developed a Library based on gnustep base. I am now running it under 
>> valgrind.
>> I am getting memory leaks detected when I do a [aNsString cString].
>> From what I read in the API docs, the returned char* is not owned by my 
>> code, so I do a [aNsString release] after using it.
>> 
>> Can anyone shed some light into this ?
>> Thanks,
>> Regards
>> 
>> Daniel Santos
>> 
>> 
>> 
>> 
>> 

Reply via email to