Skip to content

Commit

Permalink
fixed faulty use of get_allocator.
Browse files Browse the repository at this point in the history
Closes #193.
  • Loading branch information
klemens-morgenstern committed Jul 22, 2024
1 parent af72ced commit 66c1196
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/detail/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ namespace boost::cobalt::detail

void self_destroy(std::coroutine_handle<void> h, const cobalt::executor & exec) noexcept
{
#if defined(BOOST_COBALT_NO_PMR)
asio::post(exec, [del=unique_handle<void>(h.address())]() mutable {});
#else
asio::post(exec,
asio::bind_allocator(
this_thread::get_allocator(),
[del=unique_handle<void>(h.address())]() mutable
{
}));
#endif

}
#endif

Expand Down

0 comments on commit 66c1196

Please sign in to comment.