Fix pure virtual function call (#3979)

This commit is contained in:
Adrian Cojocaru
2025-11-28 23:09:10 +02:00
committed by GitHub
parent 306845c18d
commit b930e57e8b
4 changed files with 16 additions and 0 deletions

View File

@@ -15,6 +15,12 @@ VectorMLTTile::VectorMLTTile(const OverscaledTileID& id_,
TileObserver* observer_)
: VectorTile(id_, std::move(sourceID_), parameters_, tileset_, observer_) {}
VectorMLTTile::~VectorMLTTile() {
// Don't rely on `~TileLoader` to close, it's not safe to call there.
// We're still calling a virtual method from a destructor, so any overrides will not be called.
GeometryTile::cancel();
}
void VectorMLTTile::setData(const std::shared_ptr<const std::string>& data_) {
if (!obsolete) {
GeometryTile::setData(data_ ? std::make_unique<VectorMLTTileData>(data_) : nullptr);

View File

@@ -17,6 +17,8 @@ public:
const Tileset&,
TileObserver* observer = nullptr);
~VectorMLTTile() override;
void setData(const std::shared_ptr<const std::string>& data) override;
};

View File

@@ -15,6 +15,12 @@ VectorMVTTile::VectorMVTTile(const OverscaledTileID& id_,
TileObserver* observer_)
: VectorTile(id_, std::move(sourceID_), parameters_, tileset_, observer_) {}
VectorMVTTile::~VectorMVTTile() {
// Don't rely on `~TileLoader` to close, it's not safe to call there.
// We're still calling a virtual method from a destructor, so any overrides will not be called.
GeometryTile::cancel();
}
void VectorMVTTile::setData(const std::shared_ptr<const std::string>& data_) {
if (!obsolete) {
GeometryTile::setData(data_ ? std::make_unique<VectorMVTTileData>(data_) : nullptr);

View File

@@ -17,6 +17,8 @@ public:
const Tileset&,
TileObserver* observer = nullptr);
~VectorMVTTile() override;
void setData(const std::shared_ptr<const std::string>& data) override;
};