summaryrefslogtreecommitdiff
path: root/include/mbgl/actor
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/actor
parentda490c2b90125bf82fc84b1782a795e48ab5a548 (diff)
downloadqtlocation-mapboxgl-f62e5b00c98b50e9d9a1e76f4ae5e70129e83ff4.tar.gz
[core] Introduce Scheduler::makeWeakPtr()
Diffstat (limited to 'include/mbgl/actor')
-rw-r--r--include/mbgl/actor/scheduler.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mbgl/actor/scheduler.hpp b/include/mbgl/actor/scheduler.hpp
index ca34901cfd..7338c3ab3a 100644
--- a/include/mbgl/actor/scheduler.hpp
+++ b/include/mbgl/actor/scheduler.hpp
@@ -1,5 +1,7 @@
#pragma once
+#include <mapbox/weak.hpp>
+
#include <functional>
#include <memory>
@@ -35,6 +37,8 @@ public:
// Enqueues a function for execution.
virtual void schedule(std::function<void()>) = 0;
+ // Makes a weak pointer to this Scheduler.
+ virtual mapbox::base::WeakPtr<Scheduler> makeWeakPtr() = 0;
// Set/Get the current Scheduler for this thread
static Scheduler* GetCurrent();