Boost logo

Boost Users :

From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2019-09-11 00:10:36

On Mon, Sep 9, 2019 at 11:10 PM Stephan Menzel via Boost-users
<boost-users_at_[hidden]> wrote:
> I'm in the process of creating more such composed ops for ever recurring
> use cases and perhaps I find a way to tie this lambdas lifetime to the whole
> operation. As it happens, my gut felling tells me there are cases when the
> timer lambda will dangle around and potentially crash, perhaps when the
> op is used and the io_service being destroyed and not polled before
> destruction. I couldn't verify this in the unit test yet but there's often
> cases like this that go overlooked.

Yes, that can happen depending on your implementation. This is solved
by tracking your objects in an execution_context::service and
performing cleanup when the io_context is shut down, as
beast::websocket::stream does:



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at