From 66c1196d2871ab29d104b8dc84ae379cf5410100 Mon Sep 17 00:00:00 2001 From: Klemens Morgenstern Date: Mon, 22 Jul 2024 21:10:42 +0800 Subject: [PATCH] fixed faulty use of get_allocator. Closes #193. --- src/detail/util.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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