[geos-devel] GEOS, Shapely, DLLs, and memory

Charlie Savage cfis at savagexi.com
Mon Apr 27 15:46:09 EDT 2009



Paul Ramsey wrote:
> On Mon, Apr 27, 2009 at 11:47 AM, Aron Bierbaum <aronbierbaum at gmail.com> wrote:
> 
>> I have attached a patch for both GEOS and Shapely that we have been
>> testing with for a few weeks without any problems. Does anyone have a
>> better way to address this issue?
> 
> Pretty simple patch... more C-API changes. Hmm. Perhaps GEOS 3.2 will
> be out sooner than one might expect.
> 
> I don't have the smarts to know if there's a better way.

There isn't.  For every piece of memory GEOS allocates and returns via 
the capi (or C++ api), it must provide a function to free it.

If you are using C++ you can get around it by providing a memory 
deallocator for objects returned from GEOS (say for std::string in this 
case) but for C you obviously can't do that.

Charlie


-- 
Charlie Savage
http://cfis.savagexi.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.osgeo.org/pipermail/geos-devel/attachments/20090427/bbef4cf8/smime.bin


More information about the geos-devel mailing list