Commit bb5610ec authored by Dominik Charousset's avatar Dominik Charousset

fixed reference counting for chained send

parent 4d881c8f
...@@ -129,8 +129,12 @@ struct thread_pool_scheduler::worker { ...@@ -129,8 +129,12 @@ struct thread_pool_scheduler::worker {
job_ptr job = nullptr; job_ptr job = nullptr;
auto fetch_pending = [&job]() -> job_ptr { auto fetch_pending = [&job]() -> job_ptr {
CPPA_REQUIRE(job != nullptr); CPPA_REQUIRE(job != nullptr);
auto ptr = job->chained_actor().release(); auto ptr = job->chained_actor().get();
return ptr ? static_cast<scheduled_actor*>(ptr) : nullptr; if (ptr) {
job->chained_actor().reset();
return static_cast<scheduled_actor*>(ptr);
}
return nullptr;
}; };
for (;;) { for (;;) {
job = aggressive_polling(); job = aggressive_polling();
......
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