Opened 5 years ago

Closed 4 years ago

#9731 closed Bugs (fixed)

io_service::~io_service does not desrtoy asio::spawn-ed coroutine (MSVC only)

Reported by: anonymous Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

Hello!

There is a bug in MSVC - it doesn't generate implicit move constructor for boost::asio::detail::coro_handler and spawn_helper (see asio/impl/spawn.hpp). Because of that, pull part of coroutine gets strongly referenced by coroutine itself and could not be destroyed during ~io_service execution.

Please consider an example in attachment. It should print:

Entering coroutine
Exiting coroutine

When compiled with MSVC, it doesn't print 2nd line.

Adding move construtors to coro_handler (in both specializations) and to spawn_helper will fix this issue.

P.S. this issue depends on https://svn.boost.org/trac/boost/ticket/9442

Attachments (1)

ticket_9731.cpp (1.4 KB) - added by mikhail.strelnikov@… 5 years ago.

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by mikhail.strelnikov@…

Attachment: ticket_9731.cpp added

comment:1 Changed 4 years ago by chris_kohlhoff

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.