Fix virtual destructors (#1453)

This is necessary because otherwise derived classes
are potentially deleted incompletely, using the destructor
of the interface.
master
gaschler 2018-10-24 18:45:58 +02:00 committed by Wally B. Feed
parent ceddabbcbb
commit 5253186cbe
2 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,8 @@ namespace mapping {
class GridInterface { class GridInterface {
// todo(kdaun) move mutual functions of Grid2D/3D here // todo(kdaun) move mutual functions of Grid2D/3D here
public:
virtual ~GridInterface() {}
}; };
} // namespace mapping } // namespace mapping

View File

@ -32,6 +32,8 @@ proto::RangeDataInserterOptions CreateRangeDataInserterOptions(
class RangeDataInserterInterface { class RangeDataInserterInterface {
public: public:
virtual ~RangeDataInserterInterface() {}
// Inserts 'range_data' into 'grid'. // Inserts 'range_data' into 'grid'.
virtual void Insert(const sensor::RangeData& range_data, virtual void Insert(const sensor::RangeData& range_data,
GridInterface* grid) const = 0; GridInterface* grid) const = 0;