[core] Return {Source,Layer}::getID by value

Avoid dangling references in the following sequence:

    auto& id = layer->getID();
    layer->setMaxZoom(2);
    std::cout << id;

The reference would be dangling because mutating the layer allocates a new Immutable impl, and there may be no references to the prior impl, which held the id.
This commit is contained in:
John Firebaugh
2017-05-11 10:35:45 -07:00
parent 54e26b20e7
commit afead4e749
4 changed files with 4 additions and 4 deletions

View File

@@ -19,7 +19,7 @@ SourceType Source::getType() const {
return baseImpl->type;
}
const std::string& Source::getID() const {
std::string Source::getID() const {
return baseImpl->id;
}