logo       

Re: Memory leak fixes in ogrfeaturesytle.cpp: msg#00166

gis.gdal.devel

Subject: Re: Memory leak fixes in ogrfeaturesytle.cpp

Steve Brooks wrote:
Frank,
I ran across several memory leaks in ogrfeaturestyle.cpp
with a large input file and querying the feature style string I was
getting several thousand memory leaks.
The problem was in two places, first in CreateStyleToolFromStyleString
it was not calling CSLDestroy(papszToken);
Then in the destructors of OGRStyleTool subclasses they were
only calling CPLFree(m_pasStyleValue);
The problem with this is m_pasStyleValue is a vector like class of
several OGRStyleValue's. Inside OGRStyleValue can be a pointer to a
heap allocated string in pszValue, which was the leak.
Below are the changes that fixed these leaks.

Steve,

Both sets of leaks fixed in CVS as per your suggestions.

Thanks!

--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam@xxxxxxxxx
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise