Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Make destructor virtual to avoid object splicing during destructor #9035

Merged
merged 2 commits into from
May 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ endif(WITH_COVERAGE)

set(CMAKE_CONFIGURATION_TYPES Debug Release)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -ftemplate-depth=1024 -Wall -Wextra -Wshadow -Werror -Wno-variadic-macros -Wno-unknown-pragmas")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -ftemplate-depth=1024 -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Werror -Wno-variadic-macros -Wno-unknown-pragmas")
if(APPLE)
# -Wno-error=unused-command-line-argument is required due to https://llvm.org/bugs/show_bug.cgi?id=7798
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-command-line-argument")
Expand Down
2 changes: 2 additions & 0 deletions include/mbgl/map/map_observer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ namespace mbgl {

class MapObserver {
public:
virtual ~MapObserver() = default;

static MapObserver& nullObserver() {
static MapObserver mapObserver;
return mapObserver;
Expand Down
8 changes: 5 additions & 3 deletions src/mbgl/programs/symbol_program.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class SymbolSizeAttributes : public gl::Attributes<attributes::a_size> {
// particular attribute & uniform logic needed by each possible type of the {Text,Icon}Size properties.
class SymbolSizeBinder {
public:
virtual ~SymbolSizeBinder() = default;

using Uniforms = gl::Uniforms<
uniforms::u_is_size_zoom_constant,
uniforms::u_is_size_feature_constant,
Expand Down Expand Up @@ -129,7 +131,7 @@ Range<float> getCoveringStops(Stops s, float lowerZoom, float upperZoom) {
};
}

class ConstantSymbolSizeBinder : public SymbolSizeBinder {
class ConstantSymbolSizeBinder final : public SymbolSizeBinder {
public:
using PropertyValue = variant<float, style::CameraFunction<float>>;

Expand Down Expand Up @@ -198,7 +200,7 @@ class ConstantSymbolSizeBinder : public SymbolSizeBinder {
optional<style::CameraFunction<float>> function;
};

class SourceFunctionSymbolSizeBinder : public SymbolSizeBinder {
class SourceFunctionSymbolSizeBinder final : public SymbolSizeBinder {
public:
using Vertex = gl::detail::Vertex<gl::Attribute<uint16_t, 1>>;
using VertexVector = gl::VertexVector<Vertex>;
Expand Down Expand Up @@ -251,7 +253,7 @@ class SourceFunctionSymbolSizeBinder : public SymbolSizeBinder {
optional<VertexBuffer> buffer;
};

class CompositeFunctionSymbolSizeBinder: public SymbolSizeBinder {
class CompositeFunctionSymbolSizeBinder final : public SymbolSizeBinder {
public:
using Vertex = SymbolSizeAttributes::Vertex;
using VertexVector = gl::VertexVector<Vertex>;
Expand Down
1 change: 1 addition & 0 deletions src/mbgl/sprite/sprite_atlas.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ using IconDependencies = std::set<std::string>;

class IconRequestor {
public:
virtual ~IconRequestor() = default;
virtual void onIconsAvailable(IconMap) = 0;
};

Expand Down
1 change: 1 addition & 0 deletions src/mbgl/style/sources/geojson_source_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace style {

class GeoJSONData {
public:
virtual ~GeoJSONData() = default;
virtual mapbox::geometry::feature_collection<int16_t> getTile(const CanonicalTileID&) = 0;
};

Expand Down
1 change: 1 addition & 0 deletions src/mbgl/text/glyph_atlas.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Context;

class GlyphRequestor {
public:
virtual ~GlyphRequestor() = default;
virtual void onGlyphsAvailable(GlyphPositionMap) = 0;
};

Expand Down