[Gdal-dev] Memory Leaks

Frank Warmerdam fwarmerdam at gmail.com
Tue Aug 30 11:57:42 EDT 2005


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




More information about the Gdal-dev mailing list