diff --git a/src/detail/util.cpp b/src/detail/util.cpp index 3d0202af..d2451462 100644 --- a/src/detail/util.cpp +++ b/src/detail/util.cpp @@ -18,12 +18,17 @@ namespace boost::cobalt::detail void self_destroy(std::coroutine_handle h, const cobalt::executor & exec) noexcept { +#if defined(BOOST_COBALT_NO_PMR) + asio::post(exec, [del=unique_handle(h.address())]() mutable {}); +#else asio::post(exec, asio::bind_allocator( this_thread::get_allocator(), [del=unique_handle(h.address())]() mutable { })); +#endif + } #endif