|
Boost Users : |
From: Zian Smith (smith7005_at_[hidden])
Date: 2008-03-05 16:33:45
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
-Thanks.
#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));
}
}
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net