Skip to content

buffered_channel with range-for syntax leaks #258

@dmitryikh

Description

@dmitryikh

I'm storing std::shared_ptr inside buffered_channel:

using DataSPtr = std::shared_ptr<const Msg>;
using Channel = boost::fibers::buffered_channel<DataSPtr>;

Then using range-for loop to consume values:

Channel ch(1024);
...
for (const auto msgSPtr : ch)
{
...
}

This code leads to constantly memory leaks. The workaround with while(true) & pop_value works just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions