-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Description
It looks to me like vtzero::feature depends on having a pointer to its vtzero::layer object (specifically for getting property data):
vtzero/include/vtzero/layer.hpp
Lines 388 to 396 in 62d2640
| inline property feature::next_property() { | |
| const auto idxs = next_property_indexes(); | |
| property p{}; | |
| if (idxs.valid()) { | |
| p = {m_layer->key(idxs.key()), | |
| m_layer->value(idxs.value())}; | |
| } | |
| return p; | |
| } |
However, this requirement isn’t enforced--it's possible, for instance, to do:
vtzero::feature getFeature(vtzero::tile tile, std::string layer, uint64_t id) {
return tile.get_layer_by_name(layer).get_feature_by_id(id);
}and end up with a feature whose owning layer has been destroyed.
Since presumably the overhead of enforcing this with a shared_ptr would be undesirable, would it make sense to at least make a note of this in the documentation for feature?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels