<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Date: Mon, 27 Apr 2009 13:46:09 -0600<br>
From: Charlie Savage <<a href="mailto:cfis@savagexi.com">cfis@savagexi.com</a>><br>
Subject: Re: [geos-devel] GEOS, Shapely, DLLs, and memory<br>
To: GEOS Development List <<a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a>><br>
Message-ID: <<a href="mailto:49F60B81.8070304@savagexi.com">49F60B81.8070304@savagexi.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
<br>
<br>
Paul Ramsey wrote:<br>
> On Mon, Apr 27, 2009 at 11:47 AM, Aron Bierbaum <<a href="mailto:aronbierbaum@gmail.com">aronbierbaum@gmail.com</a>> wrote:<br>
><br>
>> I have attached a patch for both GEOS and Shapely that we have been<br>
>> testing with for a few weeks without any problems. Does anyone have a<br>
>> better way to address this issue?<br>
><br>
> Pretty simple patch... more C-API changes. Hmm. Perhaps GEOS 3.2 will<br>
> be out sooner than one might expect.<br>
><br>
> I don't have the smarts to know if there's a better way.<br>
<br>
There isn't. For every piece of memory GEOS allocates and returns via<br>
the capi (or C++ api), it must provide a function to free it.<br>
<br>
If you are using C++ you can get around it by providing a memory<br>
deallocator for objects returned from GEOS (say for std::string in this<br>
case) but for C you obviously can't do that.</blockquote><div><br>Well, there is another way (not necessarily "better"), which is to compile the GEOS dll yourself using the same runtime that you use in your main application. That is what I have been doing this whole time to avoid this issue.<br>
<br>- Ragi<br></div></div>