[geos-devel] Question about geos::io::Unload::Release()

strk at refractions.net strk at refractions.net
Sun Mar 12 06:05:26 EST 2006


static lifetime should be ok.
I dunno if it's used by client code, anyway it might 
be useful to have a 'default' factory to use instead
of having to construct (and maintain alive) a custom
one. I'd move access to it to GeometryFactory::defaultInstance()
--strk;


On Sat, Mar 11, 2006 at 09:02:42PM +0100, Mateusz Å?oskot wrote:
> strk at refractions.net wrote:
> >Geometry::INTERNAL_GEOMETRY_FACTORY should really
> >be a singleton, probably GeometryFactory::getInternalInstance()
> 
> Is this internal factory used at all?
> First, I see the only function using it is marked as deprecated:
> 
> headers/geos/geom/Geometry.h
> /// @deprecated
> //Geometry* toInternalGeometry(const Geometry *g) const;
> 
> /// @deprecated
> //Geometry* fromInternalGeometry(const Geometry *g) const;
> 
> Second, I see it's a static data member, so it's a singleton - only one
> copy shared between all instances of Geometry class.
> According to my current knowledge of GEOS,
> Geometry::INTERNAL_GEOMETRY_FACTORY
> could be declared as a static data member but non-pointer.
> Then no deletion is required
> 
> struct A;
> struct B
> {
> static A a_; // static lifetime
> }
> 
> 
> >Unload class has been introduced to procrastinate these kind
> >of cleanups :) Your assumption is correct, should only be
> >called as *last* action of a *debuggin* module, no need
> >to be called by user code, it's just there to avoid false leaks
> >reported by memory checkers.
> 
> I understand, but this gadget causes some difficulties in Unit Tests ;-)
> 
> 
> Cheers
> -- 
> Mateusz Łoskot
> http://mateusz.loskot.net
> 
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel

-- 
----------------------------------------------------------------------
State-collected Geographic Data is public property !
Reject the INSPIRE directive.
Sign the petition: http://petition.publicgeodata.org



More information about the geos-devel mailing list