diff options
author | Jesse Bounds <jesse@rebounds.net> | 2016-11-11 14:40:04 -0800 |
---|---|---|
committer | Jesse Bounds <jesse@rebounds.net> | 2016-11-13 19:56:29 -0800 |
commit | 96a7a4402ef5eac2fa17ec7b52ef24e3b10bbf29 (patch) | |
tree | 18fa208f1f5d086a8e6d8ac728b49d923c45b076 /include | |
parent | 82fcd58121f272fea8d115ae0419791a78884324 (diff) | |
download | qtlocation-mapboxgl-96a7a4402ef5eac2fa17ec7b52ef24e3b10bbf29.tar.gz |
[core] Return source and layer ownership (#7014)
When a source or layer is removed transfer ownership back to the
caller so it can (optionally) take it. Preserve the behavior that
removing a CustomLayer triggers deinitialization. Deinitialize all
custom layers when a style is destroyed in case those layers are not
explicitly removed.
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/map/map.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index b1c840e68d..0c14600c75 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -159,12 +159,12 @@ public: // Sources style::Source* getSource(const std::string& sourceID); void addSource(std::unique_ptr<style::Source>); - void removeSource(const std::string& sourceID); + std::unique_ptr<style::Source> removeSource(const std::string& sourceID); // Layers style::Layer* getLayer(const std::string& layerID); void addLayer(std::unique_ptr<style::Layer>, const optional<std::string>& beforeLayerID = {}); - void removeLayer(const std::string& layerID); + std::unique_ptr<style::Layer> removeLayer(const std::string& layerID); // Add image, bound to the style void addImage(const std::string&, std::unique_ptr<const SpriteImage>); |