Opened 10 years ago
Closed 10 years ago
#5293 closed defect (fixed)
ods driver IODSCellEvaluator missing virtual destructor
Reported by: | Kurt Schwehr | Owned by: | Kurt Schwehr |
---|---|---|---|
Priority: | normal | Milestone: | 1.10.2 |
Component: | OGR_SF | Version: | |
Severity: | minor | Keywords: | |
Cc: |
Description (last modified by )
autotest's ogr_ods.py returns the same results without or with the virtual destructor. Fix by abuchbinder at Google.
Adding this to trunk.
Would also like to add this to the 1.10 branch.
virtual ~IODSCellEvaluator() {}
Change History (6)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|---|
Status: | new → assigned |
comment:2 by , 10 years ago
follow-up: 4 comment:3 by , 10 years ago
abuchbinder is Andrew - a Googler who jumped in to help cleanup a small aspect of a GDAL build here.
I'm trying to bring back my rusty C++ skills, but:
"If your class has virtual methods, its destructor should be virtual." http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Inheritance#Inheritance
A better reference would be: Page 62-63, Item 14, Scott Meyers, Effective C++, 2nd ed.
Basically, providing that simple NOP virtual destructor definition makes sure that the parents' destructors are called as expected top from top down. You can often get away with leaving it out, but best not to.
comment:4 by , 10 years ago
Correction... Adam. Not Andrew
Replying to goatbar:
abuchbinder is Andrew - a Googler who jumped in to help cleanup a small aspect of a GDAL build here.
comment:6 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
For my own education, is the definition of the destructor that does nothing just a best practice or something mandated by the C++ language and if you don't do it, the behaviour is undefined (but apparently works well with the usual compilers) ?
Is this abuchbinder tool something private to Google or more generally available ?