[Gdal-dev] On Feature.setGeometryDirectly SWIG bindings

Andrea Aime aaime at openplans.org
Sun Apr 1 03:27:06 EDT 2007


Tamas Szekeres ha scritto:
> 2007/3/18, Andrea Aime <aaime at openplans.org>:

> Hopefully, this implementation can be achieved as:
> 
> %typemap(javacode) SWIGTYPE %{
>  protected static long getCPtrAndDisown($javaclassname obj) {
>    if (obj != null) obj.swigCMemOwn= false;
>    return getCPtr(obj);
>  }
> %}
> 
> %typemap(javain) SWIGTYPE *DISOWN 
> "$javaclassname.getCPtrAndDisown($javainput)"
> 

Tried it, and it works fine (I had some unit tests to catch the
VM crash due to the lack of DISOWN in my Geotools datastore, so
it has been tested too).

Thanks for all the help :-)
Cheers
Andrea



More information about the Gdal-dev mailing list