<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 &lt;<a href="mailto:cfis@savagexi.com">cfis@savagexi.com</a>&gt;<br>
Subject: Re: [geos-devel] GEOS, Shapely, DLLs, and memory<br>
To: GEOS Development List &lt;<a href="mailto:geos-devel@lists.osgeo.org">geos-devel@lists.osgeo.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:49F60B81.8070304@savagexi.com">49F60B81.8070304@savagexi.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
<br>
<br>
Paul Ramsey wrote:<br>
&gt; On Mon, Apr 27, 2009 at 11:47 AM, Aron Bierbaum &lt;<a href="mailto:aronbierbaum@gmail.com">aronbierbaum@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; I have attached a patch for both GEOS and Shapely that we have been<br>
&gt;&gt; testing with for a few weeks without any problems. Does anyone have a<br>
&gt;&gt; better way to address this issue?<br>
&gt;<br>
&gt; Pretty simple patch... more C-API changes. Hmm. Perhaps GEOS 3.2 will<br>
&gt; be out sooner than one might expect.<br>
&gt;<br>
&gt; I don&#39;t have the smarts to know if there&#39;s a better way.<br>
<br>
There isn&#39;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&#39;t do that.</blockquote><div><br>Well, there is another way (not necessarily &quot;better&quot;), 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>