diff options
Diffstat (limited to 'include/mbgl/style/sources/image_source.hpp')
-rw-r--r-- | include/mbgl/style/sources/image_source.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/mbgl/style/sources/image_source.hpp b/include/mbgl/style/sources/image_source.hpp index 009764291f..84faab33c9 100644 --- a/include/mbgl/style/sources/image_source.hpp +++ b/include/mbgl/style/sources/image_source.hpp @@ -10,7 +10,7 @@ class AsyncRequest; namespace style { -class ImageSource : public Source { +class ImageSource final : public Source { public: ImageSource(std::string id, const std::array<LatLng, 4>); ~ImageSource() override; @@ -27,9 +27,14 @@ public: const Impl& impl() const; void loadDescription(FileSource&) final; + + mapbox::base::WeakPtr<Source> makeWeakPtr() override { + return weakFactory.makeWeakPtr(); + } private: optional<std::string> url; std::unique_ptr<AsyncRequest> req; + mapbox::base::WeakPtrFactory<Source> weakFactory {this}; }; template <> |