Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-03-05 16:54:30


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));
> }
> }


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