
5 Mar
2008
5 Mar
'08
9:54 p.m.
Zian Smith:
Hello,
The following program seems to exhibit a memory leak. The program itself does nothing. Can someone explain please? I'm using boost 1.33.1
FWIW, I'm not seeing any leaks with MSVC 7.1 and the current Boost trunk. ...
#include "boost/lambda/bind.hpp" #include "boost/shared_ptr.hpp"
void do_nothing(boost::shared_ptr<int> intPtr) {
}
int main() { while(1) { char c[10]; boost::shared_ptr<int> intPtr(new int); std::for_each(c, c+10, boost::lambda::bind(do_nothing, intPtr)); } }