Commit 69a6b5ce authored by Dominik Charousset's avatar Dominik Charousset

Set correct actor ID before running constructors

parent 1d1dfa3b
...@@ -33,22 +33,23 @@ namespace caf { ...@@ -33,22 +33,23 @@ namespace caf {
template <class T, class R = infer_handle_from_class_t<T>, class... Ts> template <class T, class R = infer_handle_from_class_t<T>, class... Ts>
R make_actor(actor_id aid, node_id nid, actor_system* sys, Ts&&... xs) { R make_actor(actor_id aid, node_id nid, actor_system* sys, Ts&&... xs) {
#if CAF_LOG_LEVEL >= CAF_LOG_LEVEL_DEBUG #if CAF_LOG_LEVEL >= CAF_LOG_LEVEL_DEBUG
actor_storage<T>* ptr = nullptr;
if (logger::current_logger()->accepts(CAF_LOG_LEVEL_DEBUG, if (logger::current_logger()->accepts(CAF_LOG_LEVEL_DEBUG,
CAF_LOG_FLOW_COMPONENT)) { CAF_LOG_FLOW_COMPONENT)) {
std::string args; std::string args;
args = deep_to_string(std::forward_as_tuple(xs...)); args = deep_to_string(std::forward_as_tuple(xs...));
ptr actor_storage<T>* ptr;
= new actor_storage<T>(aid, std::move(nid), sys, std::forward<Ts>(xs)...); {
CAF_PUSH_AID(aid);
ptr = new actor_storage<T>(aid, std::move(nid), sys,
std::forward<Ts>(xs)...);
}
CAF_LOG_SPAWN_EVENT(ptr->data, args); CAF_LOG_SPAWN_EVENT(ptr->data, args);
} else { return {&(ptr->ctrl), false};
ptr
= new actor_storage<T>(aid, std::move(nid), sys, std::forward<Ts>(xs)...);
} }
#else
auto ptr
= new actor_storage<T>(aid, std::move(nid), sys, std::forward<Ts>(xs)...);
#endif #endif
CAF_PUSH_AID(aid);
auto ptr = new actor_storage<T>(aid, std::move(nid), sys,
std::forward<Ts>(xs)...);
return {&(ptr->ctrl), false}; return {&(ptr->ctrl), false};
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment