[Gdal-dev] Memory Leaks

Ned Harding nharding at extendthereach.com
Tue Aug 30 13:33:04 EDT 2005


Thanks Frank...   

Is there any harm in calling CPLCleanupTLS in a thread and then using that
thread again?  Will it make new structures?  If so, that will make it easy
for me to reference count.

Otherwise, is there any harm in calling it if it has never been initialized?

And finally, has anything been done in OGR post 1.3 that would be risky for
production code?

Thanks again,

Ned.

-----Original Message-----
From: Frank Warmerdam [mailto:fwarmerdam at gmail.com] 
Sent: Tuesday, August 30, 2005 8:58 AM
To: Ned Harding
Cc: Gdal-dev at lists.maptools.org
Subject: Re: [Gdal-dev] Memory Leaks

On 8/30/05, Ned Harding <nharding at extendthereach.com> wrote:
>  
> 
> I am trying to clear out all my memory leaks in a project I have.  I 
> have 2 memory leaks in OGR that I can't figure out.  These are minor, 
> but I'd still rather not have any leaks since this code can be used 
> for a server process that is expected to live for a long time.
> 
> 2 functions allocate memory that never get free'd again. 
> 
> CPLGetErrorContext
> CPLGetTLSList

Ned, 

I would *love* to be able to clear these up properly, but I am not sure
about how to register "atexit" handers for threads in a cross platform way.
In the meantime, you can call CPLCleanupTLS() at the point where the threads
are exiting. 

Note that CPLCleanupTLS() was added after the 1.3.0 release, so you would
need to be using GDAL CVS to get it. 

Best regards,
-- 
---------------------------------------+--------------------------------
---------------------------------------+------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20050830/025fa8b9/attachment.html


More information about the Gdal-dev mailing list