Skip to content

Commit

Permalink
Making sure any function object passed to dataflow is released after …
Browse files Browse the repository at this point in the history
…being invoked

- this fixes test problems with the executor_parameters_timer_hooks test
  • Loading branch information
hkaiser committed Oct 17, 2017
1 parent e6dca4d commit 336effe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hpx/lcos/dataflow.hpp
Expand Up @@ -133,8 +133,10 @@ namespace hpx { namespace lcos { namespace detail
void execute(std::false_type, Futures&& futures)
{
try {
Func func = std::move(func_);

result_type res =
util::invoke_fused(func_, std::move(futures));
util::invoke_fused(std::move(func), std::move(futures));

this->set_data(std::move(res));
}
Expand All @@ -149,7 +151,9 @@ namespace hpx { namespace lcos { namespace detail
void execute(std::true_type, Futures&& futures)
{
try {
util::invoke_fused(func_, std::move(futures));
Func func = std::move(func_);

util::invoke_fused(std::move(func), std::move(futures));

this->set_data(util::unused_type());
}
Expand Down

0 comments on commit 336effe

Please sign in to comment.