From 515ffa975d027c7c1479b2d0211e798c25148d60 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Wed, 21 Jun 2017 20:44:26 +0300 Subject: [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> transform) { resourceTransform = transform; } optional> resourceTransform; --- include/mbgl/actor/actor_ref.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/mbgl') 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 ActorRef { public: ActorRef(Object& object_, std::weak_ptr weakMailbox_) - : object(object_), + : object(&object_), weakMailbox(std::move(weakMailbox_)) { } template void invoke(Fn fn, Args&&... args) { if (auto mailbox = weakMailbox.lock()) { - mailbox->push(actor::makeMessage(object, fn, std::forward(args)...)); + mailbox->push(actor::makeMessage(*object, fn, std::forward(args)...)); } } private: - Object& object; + Object* object; std::weak_ptr weakMailbox; }; -- cgit v1.2.1