Opened 18 years ago

Last modified 15 years ago

#73 closed defect (fixed)

Many classes have no virtual destructor but having virtual member functions

Reported by: mloskot Owned by: strk@…
Priority: critical Milestone:
Component: Core Version: main
Severity: Critical Keywords: imported, phpbugtracker
Cc:

Description (last modified by mloskot)

Today, I identified 25 classes that have some virtual member functions but don't have a virtual destructor. Those classes should have vritual destructors.

The rule of thumb is:

make your destructor virtual if your class has any virtual functions

It does not introduces any unnecessary overhead and does not decrease performance.

At least, base classes should have virtual destructors. All classes derived from such base class will have virtual destructors by default (even implicitly).

Here is a list of classes that should get virtual destructors:

geos::geom::CoordinateSequenceFactory
geos::geom::CoordinateArraySequenceFactory
geos::geom::CoordinateSequenceFactory
geos::geom::GeometryComponentFilter
geos::geom::GeometryFilter
geos::geom::util::CoordinateOperation
geos::geom::util::GeometryEditorOperation
geos::geom::util::LinearComponentExtracter
geos::geom::util::PointExtracter
geos::geom::util::ShortCircuitedGeometryVisitor
geos::geomgraph::NodeFactory
geos::index::ItemVisitor
geos::index::strtree::AbstractSTRtree::IntersectsOp
geos::index::strtree::SIRtree::SIRIntersectsOp
geos::index::sweepline::SweepLineOverlapAction
geos::operation::distance::ConnectedElementPointFilter
geos::operation::distance::ConnectedElementLocationFilter
geos::operation::overlay::OverlayNodeFactory
geos::operation::polygonize::Polygonizer::LineStringAdder
geos::operation::predicate::EnvelopeIntersectsVisitor
geos::operation::predicate::ContainsPointVisitor
geos::operation::predicate::LineIntersectsVisitor
geos::operation::relate::RelateNodeFactory
geos::operation::valid::SweeplineNestedRingTester::OverlapAction
geos::precision::PrecisionReducerCoordinateOperation

Change History (6)

comment:1 by mateusz@…, 18 years ago

I'm taking this bug to fix.

comment:2 by strk@…, 18 years ago

Resolution: nonefixed

comment:3 by mateusz@…, 18 years ago

Sandro, has this bug been fixed already so you closed it?

comment:4 by strk@…, 18 years ago

Yes, AFAIKT. I took buildbot 'make' output log to tell. Let me know if you see others.

comment:5 by mloskot, 16 years ago

Description: modified (diff)
Milestone: imported3.0.0
Priority: 5critical
Reporter: changed from mateusz@… to mloskot
Version: 3.0.0svn-trunk

comment:6 by (none), 15 years ago

Milestone: 3.0.0

Milestone 3.0.0 deleted

Note: See TracTickets for help on using tickets.