summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2017-06-21 20:44:26 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-06-26 16:32:21 +0300
commit515ffa975d027c7c1479b2d0211e798c25148d60 (patch)
treed093267a7f540f7fb2eff369894269b3c78124ff /include
parent6beccef517250ecb24361caf5b71da6ce4f93c97 (diff)
downloadqtlocation-mapboxgl-515ffa975d027c7c1479b2d0211e798c25148d60.tar.gz
[core] Store pointer instead of referect to the Object in ActorRef
GCC complains about implicitly deleted assigment constructor when trying to do this: void setResourceTransform(optional<ActorRef<ResourceTransform>> transform) { resourceTransform = transform; } optional<ActorRef<ResourceTransform>> resourceTransform;
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/actor/actor_ref.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/mbgl/actor/actor_ref.hpp b/include/mbgl/actor/actor_ref.hpp
index 9d858d823f..aeb5bb4507 100644
--- a/include/mbgl/actor/actor_ref.hpp
+++ b/include/mbgl/actor/actor_ref.hpp
@@ -24,19 +24,19 @@ template <class Object>
class ActorRef {
public:
ActorRef(Object& object_, std::weak_ptr<Mailbox> weakMailbox_)
- : object(object_),
+ : object(&object_),
weakMailbox(std::move(weakMailbox_)) {
}
template <typename Fn, class... Args>
void invoke(Fn fn, Args&&... args) {
if (auto mailbox = weakMailbox.lock()) {
- mailbox->push(actor::makeMessage(object, fn, std::forward<Args>(args)...));
+ mailbox->push(actor::makeMessage(*object, fn, std::forward<Args>(args)...));
}
}
private:
- Object& object;
+ Object* object;
std::weak_ptr<Mailbox> weakMailbox;
};