id summary reporter owner description type status milestone component version severity resolution keywords cc 7861 lockfree freelist doesn't destruct objects until its destructor is called toffaletti@… timblechmann "This code demonstrates the problem: {{{ $ cat leak.cc #include #include #include #include #include static std::atomic count{0}; struct LeakFinder { LeakFinder() { ++count; } ~LeakFinder() { --count; } }; static boost::lockfree::queue> queue(128); static bool done = false; void producer() { for (int i=0; i<1; ++i) { queue.push(std::make_shared()); } } void consumer() { while (!done) { std::shared_ptr v; while (queue.pop(v)); } } int main() { std::vector producer_threads; std::vector consumer_threads; for (int i=0; i<1; ++i) { producer_threads.emplace_back(producer); } for (int i=0; i<1; ++i) { consumer_threads.emplace_back(producer); } for (auto &t : producer_threads) { t.join(); } done = true; for (auto &t : consumer_threads) { t.join(); } std::cout << ""leak: "" << count << ""\n""; } }}} {{{ $ g++ -ggdb -std=c++11 -pthread -I/home/jason/boost-1.53/include leak.cc $ ./a.out leak: 2 }}} I think destructors should be called when memory is added to freelist. " Bugs closed To Be Determined lockfree Boost 1.53.0 Problem fixed