Commit 33424d0f authored by Dominik Charousset's avatar Dominik Charousset

Fix #151 by releasing references held by functors

parent 610faee4
...@@ -34,7 +34,12 @@ void event_based_actor::forward_to(const actor& whom, ...@@ -34,7 +34,12 @@ void event_based_actor::forward_to(const actor& whom,
} }
behavior event_based_actor::functor_based::make_behavior() { behavior event_based_actor::functor_based::make_behavior() {
return m_make_behavior(this); auto res = m_make_behavior(this);
// reset make_behavior_fun to get rid of any
// references held by the function object
make_behavior_fun tmp;
m_make_behavior.swap(tmp);
return res;
} }
} // namespace caf } // namespace caf
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