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: | |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | Core | Version: | main |
Severity: | Critical | Keywords: | imported, phpbugtracker |
Cc: |
Description (last modified by )
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:2 by , 18 years ago
Resolution: | none → fixed |
---|
comment:4 by , 18 years ago
Yes, AFAIKT. I took buildbot 'make' output log to tell. Let me know if you see others.
comment:5 by , 16 years ago
Description: | modified (diff) |
---|---|
Milestone: | imported → 3.0.0 |
Priority: | 5 → critical |
Reporter: | changed from | to
Version: | 3.0.0 → svn-trunk |
Note:
See TracTickets
for help on using tickets.