[geos-devel] Automatic memory management for GeometryFactory objects

Sandro Santilli strk at keybit.net
Fri Oct 2 03:07:24 PDT 2015

As part of the effort to expose PrecisionModel to the C-API I've
just committed a change to the C++ API introducing automatic memory
management for GeometryFactory objects.

GeometryFactory objects will now be automatically deleted when its owner
drops it _and_ the last referencing Geometry is deleted.

Ownership of GeometryFactory object is delegated to a
GeometryFactory::unique_ptr smart pointer with ownership transfer

The change does not go as deep as ensuring _all_ referees register
themselves into the GeometryFactory, but only the Geometry objects
do. This means you still have to take care of keeping your
GeometryFactory alive (by keeping the unique smart pointer alive)
if storing a reference to it in any other place.

Code is in r4091


  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html

More information about the geos-devel mailing list