Boost logo

Boost Users :

From: alansa_at_[hidden]
Date: 2004-11-19 07:46:19


The following code leaks memory for each iteration of the loop

for (;;)
{
        boost::thread t(func);
        t.join();
}

void func()
{
        cout << "------" << endl;
}

If I replace func with func2

void func2()
{
        try
        {
                throw 1;
        }
        catch {}
}

then it still leaks.

But if I say fill up a vector with stuff or just return there is no leek.

The interesting part is that it doesn't leak if use the version of threads
built using the CRT as a .dll rather than static link. I also believe that
the actual culprit is somewhere in boost.function since the code for
boost.thread is so straight forward.

I'm currently using boost 1.30 so it might have already been addressed in
newer versions.

Can anyone help?


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