diff --git a/include/boost/coroutine2/detail/pull_control_block_ecv1.ipp b/include/boost/coroutine2/detail/pull_control_block_ecv1.ipp index 5edd438..eb2ae27 100644 --- a/include/boost/coroutine2/detail/pull_control_block_ecv1.ipp +++ b/include/boost/coroutine2/detail/pull_control_block_ecv1.ipp @@ -125,6 +125,7 @@ pull_coroutine< T >::control_block::~control_block() { if ( state_t::none == ( state & state_t::complete) && state_t::none != ( state & state_t::unwind) ) { // unwind coroutine stack + other->ctx = boost::context::execution_context::current(); ctx( context::exec_ontop_arg, unwind_coroutine); } // destroy data if it set @@ -273,6 +274,7 @@ pull_coroutine< T & >::control_block::~control_block() { if ( state_t::none == ( state & state_t::complete) && state_t::none != ( state & state_t::unwind) ) { // unwind coroutine stack + other->ctx = boost::context::execution_context::current(); ctx( context::exec_ontop_arg, unwind_coroutine); } } @@ -399,6 +401,7 @@ pull_coroutine< void >::control_block::~control_block() { if ( state_t::none == ( state & state_t::complete) && state_t::none != ( state & state_t::unwind) ) { // unwind coroutine stack + other->ctx = boost::context::execution_context::current(); ctx( context::exec_ontop_arg, unwind_coroutine); } } diff --git a/include/boost/coroutine2/detail/push_control_block_ecv1.ipp b/include/boost/coroutine2/detail/push_control_block_ecv1.ipp index e5546d1..cc9622d 100644 --- a/include/boost/coroutine2/detail/push_control_block_ecv1.ipp +++ b/include/boost/coroutine2/detail/push_control_block_ecv1.ipp @@ -130,6 +130,7 @@ push_coroutine< T >::control_block::~control_block() { if ( state_t::none == ( state & state_t::complete) && state_t::none != ( state & state_t::unwind) ) { // unwind coroutine stack + other->ctx = boost::context::execution_context::current(); ctx( context::exec_ontop_arg, unwind_coroutine); } } @@ -271,6 +272,7 @@ push_coroutine< T & >::control_block::~control_block() { if ( state_t::none == ( state & state_t::complete) && state_t::none != ( state & state_t::unwind) ) { // unwind coroutine stack + other->ctx = boost::context::execution_context::current(); ctx( context::exec_ontop_arg, unwind_coroutine); } } @@ -396,6 +398,7 @@ push_coroutine< void >::control_block::~control_block() { if ( state_t::none == ( state & state_t::complete) && state_t::none != ( state & state_t::unwind) ) { // unwind coroutine stack + other->ctx = boost::context::execution_context::current(); ctx( context::exec_ontop_arg, unwind_coroutine); } }