[geos-devel] How to destroy PreparedGeometry object?

Martin Davis mbdavis at refractions.net
Mon Aug 11 18:38:20 EDT 2008


I would think that there should be a destructor defined for the 
PreparedGeometry class.  Would this be the appropriate C++ pattern?

Mateusz Loskot wrote:
> Folks,
>
> There is PreparedGeometryFactory class with create/prepare methods.
> Both return object of PreparedGeometry type dynamically allocated on 
> heap (using new operator).
>
> Now, how such geometry returned from the factory is supposed to be 
> destroyed?
>
> Comparing to GeometryFactory, there is destroyGeometry method that 
> accepts pointer to object of Geometry type. It works well.
>
> Back to prepared geometry, GeometryFactory::destroyGeometry() can not 
> be used to destroy object of type of PreparedGeometry because it is 
> unrelated in any way to Geometry type, so no casting is possible.
>
> For me it looks that there is one method missing 
> PreparedGeometryFactory::destroyGeometry, though I may have missed 
> some other way to destroy prep geom.
>
> Any suggestions?
>
> Best regards,

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022



More information about the geos-devel mailing list