[geos-devel] GeometryCollection constructor

Norman Vine nhv at cape.com
Wed Oct 8 06:54:51 EDT 2003


strk writes:
> 
> Constructing a GeometryCollection from a vector of Geometry pointer
> right now will just copy the pointer to that vector to private 
> space, this mean that after having constructed the geometries forming
> the collection and having put them in a vector you pass the
> vector to new GeometryCollection and you are left with pointers to
> memory that from now on should be manipulated only by the
> GeometryCollection object.
> I don't think this is correct. Latest postgis tries to delete the
> vector used to contain child geoms and thus segfaults. I patched
> GeometryCollection to copy the actual vector, not just the pointer,
> but my question is: should memory copy go further copying each
> object in the vector instead of just the vector itself ?

Ack...

I thought we were going to use reference counted pointers
just so we could *safely* pass pointers instead of objects around
and not have to worry about objects being prematurely deleted
or conversely needlessly left on the heap !!

Cheers

Norman
 



More information about the geos-devel mailing list