summaryrefslogtreecommitdiff
path: root/include/mbgl/util
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-10-09 16:23:12 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-10-09 23:46:11 +0300
commitf62e5b00c98b50e9d9a1e76f4ae5e70129e83ff4 (patch)
treed5c639664127f009ff3d720be518f6bd157d7e4b /include/mbgl/util
parentda490c2b90125bf82fc84b1782a795e48ab5a548 (diff)
downloadqtlocation-mapboxgl-f62e5b00c98b50e9d9a1e76f4ae5e70129e83ff4.tar.gz
[core] Introduce Scheduler::makeWeakPtr()
Diffstat (limited to 'include/mbgl/util')
-rw-r--r--include/mbgl/util/run_loop.hpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/mbgl/util/run_loop.hpp b/include/mbgl/util/run_loop.hpp
index 961573fd87..5cde95a531 100644
--- a/include/mbgl/util/run_loop.hpp
+++ b/include/mbgl/util/run_loop.hpp
@@ -74,6 +74,7 @@ public:
}
void schedule(std::function<void()> fn) override { invoke(std::move(fn)); }
+ ::mapbox::base::WeakPtr<Scheduler> makeWeakPtr() override { return weakFactory.makeWeakPtr(); }
class Impl;
@@ -121,6 +122,7 @@ private:
std::mutex mutex;
std::unique_ptr<Impl> impl;
+ ::mapbox::base::WeakPtrFactory<Scheduler> weakFactory{this};
};
} // namespace util