From 5207a360746d7d0541e21ca4e8d22b432f41d8f5 Mon Sep 17 00:00:00 2001 From: Mikhail Pozdnyakov Date: Tue, 10 Sep 2019 06:55:38 +0300 Subject: [core, ios, macos] SDK objects should hold weak pointers to the core style objects (#15539) --- include/mbgl/style/sources/custom_geometry_source.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/mbgl/style/sources/custom_geometry_source.hpp') diff --git a/include/mbgl/style/sources/custom_geometry_source.hpp b/include/mbgl/style/sources/custom_geometry_source.hpp index 3f29d0c0fb..a5e545f445 100644 --- a/include/mbgl/style/sources/custom_geometry_source.hpp +++ b/include/mbgl/style/sources/custom_geometry_source.hpp @@ -20,7 +20,7 @@ using TileFunction = std::function; class CustomTileLoader; -class CustomGeometrySource : public Source { +class CustomGeometrySource final : public Source { public: struct TileOptions { double tolerance = 0.375; @@ -46,9 +46,13 @@ public: // Private implementation class Impl; const Impl& impl() const; + mapbox::base::WeakPtr makeWeakPtr() override { + return weakFactory.makeWeakPtr(); + } private: std::shared_ptr threadPool; std::unique_ptr> loader; + mapbox::base::WeakPtrFactory weakFactory {this}; }; template <> -- cgit v1.2.1