From edf40bb6d9f0ee3731f39de597ce9a167571ea5b Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Fri, 11 Nov 2016 14:40:04 -0800 Subject: [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. --- include/mbgl/map/map.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/mbgl/map') diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 6656bccd51..aaec346731 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); - void removeSource(const std::string& sourceID); + std::unique_ptr removeSource(const std::string& sourceID); // Layers style::Layer* getLayer(const std::string& layerID); void addLayer(std::unique_ptr, const optional& beforeLayerID = {}); - void removeLayer(const std::string& layerID); + std::unique_ptr removeLayer(const std::string& layerID); // Add image, bound to the style void addImage(const std::string&, std::unique_ptr); -- cgit v1.2.1